简体   繁体   English

在Android上使用AbsoluteLayout?

[英]Using AbsoluteLayout on Android?

All pages of my application use the AbsoluteLayout which is deprecated. 我的应用程序的所有页面都使用AbsoluteLayout,它已被弃用。 I was told that the reason i should not use absolutelayout is that it's not flexible in different screen sizes. 有人告诉我,我不应该使用absolutelayout的原因是它在不同的屏幕尺寸下不灵活。

I tested my app with every simulator comes with android sdk, and I had no problem. 我在每个带有android sdk的模拟器中测试了我的应用程序,但没有问题。 But all screens on all simulators seem to have the same size. 但是所有模拟器上的所有屏幕似乎都具有相同的尺寸。 am i safe to go with absolute layout as long as it works on all simulators? 只要可以在所有模拟器上使用绝对布局,我是否可以安全使用? 1.1, 1.5, 1.6, 2.0, 2.0.1, 2.2, 2.2 1.1、1.5、1.6、2.0、2.0.1、2.2、2.2

You can set screen size when creating AVD (by changing Skin Default HVGA to some other). 您可以在创建AVD时设置屏幕尺寸(通过将Skin Default HVGA更改为其他)。 And you can also change orientation pressing 7 and 9 keys on numeric keyboard. 您还可以按数字键盘上的7和9键来更改方向。

If all screens on all simulators seem to have the same sizem it's because you are not changing it's resolution at the moment of create them. 如果所有模拟器上的所有屏幕似乎都具有相同的sizem,那是因为在创建它们时您没有更改其分辨率。 See Gawcio's response. 请参阅Gawcio的回复。

am i safe to go with absolute layout as long as it works on all simulators? 只要可以在所有模拟器上使用绝对布局,我是否可以安全使用?

No, you are not. 不,你不是。 You must stop using AbsoluteLayout ... there are better ways to build your application. 您必须停止使用AbsoluteLayout ...有更好的方法来构建应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM