开发者

Testing Android application with different-sized screens

开发者 https://www.devze.com 2023-03-25 23:28 出处:网络
I have a question for you guys about multiple screens. I am testing an Android application for different-sized screens using emulator. The application have been initially developed for resolution 32

I have a question for you guys about multiple screens.

I am testing an Android application for different-sized screens using emulator. The application have been initially developed for resolution 320*480. I know it is not good and I have problems in my code. Moreover, I have used pixels in some places of code instead of dip. You see, I am not a professional in Android. In any case, there is no problem for devices with resolution 320*480 and 480*800. For the second one the application looks stretched. According to documentation it should be so. But, when I am trying resolutions 540*960 or 1024*600 the application occupies just a part of screen and it seems to be 320*480. The question is: why it didn't stretched the application to the whole screen? How can I do it?

I have read Supporting Multiple Screens guide here: http://developer.android.com/guide/practices/screens_support.html#dips-pels, but I haven't found an answer for my questio开发者_开发问答n.


Have you go through this lines in the link given by you?

res/layout/my_layout.xml // layout for normal screen size ("default")

res/layout-small/my_layout.xml // layout for small screen size

res/layout-large/my_layout.xml // layout for large screen size

res/layout-xlarge/my_layout.xml // layout for extra large screen size i

res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation

res/drawable-mdpi/my_icon.png // bitmap for medium density

res/drawable-hdpi/my_icon.png // bitmap for high density

res/drawable-xhdpi/my_icon.png // bitmap for extra high density

for different size devices, make different folder as given above like layout-small,layout-large.. and put your designing xml in that.

Hope this help you.

0

精彩评论

暂无评论...
验证码 换一张
取 消