Supporting Multiple Screens in Android Devices?
I developed a sample web application and hosted that .apk build file in different Android version and on different sized devices, here I am getting problems in my design in layout such as listview not being displayed properly, bottom portion not displaying well, and the alignment not开发者_如何学编程 so good.
You can use these in the manifest:
<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"/>
I recently came across a problem when creating my first game. After attempting to fix the issue of different screen sizes, I also realized you need to worry about pixel density as well. I'm not too sure what all you have being drawn to the screen but you can have those resized as needed to be the same ratio with the screen on any device. All you might have to do is add the following code to the manifest section of the Manifest:
<supports-screens
android:anyDensity="false"/>
This took care of my problem with different devices, I hope it works for you as well!
精彩评论