开发者

Android - Strange behavior with different screen resolutions

开发者 https://www.devze.com 2023-01-23 20:26 出处:网络
I\'m having some problem with screen resolutions in Android. I found the problem when I first ran my application on a VGA AVD and the application\'s images did not occupy the % of the screen I was e

I'm having some problem with screen resolutions in Android.

I found the problem when I first ran my application on a VGA AVD and the application's images did not occupy the % of the screen I was expecting them to. I tried to run it on HVGA and QVGA and found out that they all occupied the exact same % of the screen, as if the screen resolution was the same.

In fact, resolution was the same: I debugged my program and checked the width and height when onSizeChanged was called, and got the same values for all the AVDs (320 x开发者_如何学JAVA 430, or 320 x 483 for wide resolutions). I created some AVDs and manually set their resolution, but the behavior did not change.

My activity's content view, that is giving me these wrong resolutions, is a class which inherits from View.


I had the same problem, adding a "minSdkVersion" to my AndroidManifest.xml solved it.

0

精彩评论

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