how to i develop android application to work in different screen resolutions

喜你入骨 提交于 2019-12-30 07:40:13

问题


I,m working on android project. Actually i have develop on small app in honeycomb with resolution(1024*600), when am running the same app in different resolution let say android 2.2(froyo) screen the alignment of images in app screen changes.

Note:Images that are place in xml file are manual arranged(no wrapper thing used for width and height)

Please help me out this question asap..

regards,

Murali...G


回答1:


Mainly we need to look up is the usage of UI patterns like action bar, Dashboard etc. But the key point is you should use less static images and as you also use tablet. You should've used Fragments(Of course you would ve done. In case if you have done. Please do it).

Also use 9 patch images or colors for backgrounds. If you are using different images then. You need to keep images for different density.

Maybe all I say is abstract as this question is a abstract one. There is no one line answer for this. As this is a process by itself.




回答2:


//design your xml in this way

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
res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation



Low density Small screens QVGA 240x320 

res/layout-small-ldpi
res/layout-small-land-ldpi

Low density Normal screens WVGA400 240x400 (x432)

res/layout-ldpi
res/layout-land-ldpi

Medium density Normal screens HVGA 320x480

res/layout-mdpi
res/layout-land-mdpi

Medium density Large screens HVGA 320x480

res/layout-large-mdpi
res/layout-large-land-mdpi

High density Normal screens WVGA800 480x800 (x854)

res/layout-hdpi
res/layout-land-hdpi

Xoom (medium density large but 1280x800 res)



回答3:


Check this Android class: http://developer.android.com/training/multiscreen/index.html



来源:https://stackoverflow.com/questions/8530914/how-to-i-develop-android-application-to-work-in-different-screen-resolutions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!