Supporting Multiple Screens in android? [duplicate]

折月煮酒 提交于 2019-12-08 10:28:18

问题


In my application, I am setting multiple screen support. In my layout am using layout-normal it supports 320x480 and 480X720hdpi(I think, because it takes it from layout-normal)every layout fit to both resolution perfectly, But pop up window not fit for 480X720 resolution.

Please refer my image 320x480 screen image and 480x720 screen image will know the problem. How to solve the problem.

1.320X480 Screen 2.480x720 Screen


回答1:


Add you layout to every folder like

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

In Manifest add support-screens

<supports-screens android:resizeable=["true"| "false"]
                  android:smallScreens=["true" | "false"]
                  android:normalScreens=["true" | "false"]
                  android:largeScreens=["true" | "false"]
                  android:xlargeScreens=["true" | "false"]
                  android:anyDensity=["true" | "false"]
                  android:requiresSmallestWidthDp="integer"
                  android:compatibleWidthLimitDp="integer"
                  android:largestWidthLimitDp="integer"/>

For more info check this link



来源:https://stackoverflow.com/questions/15269652/supporting-multiple-screens-in-android

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