Android Multiscreen Support issue

别说谁变了你拦得住时间么 提交于 2019-12-08 12:17:31

问题


hi guys i have been developing android app that should match most of the screen resolutions. And i just got struck at setting the drawable folder for this two resolution 1. 480 x 800 with approximate density of 217 2. 540 x 960 with approximate density of 240

And i have a different set of images for both the resolutions and i have set hdpi for 540 x 960 but don't have an idea of going about the 480x800 which also falls under hdpi. After goggling found a drawable qualifier called tvdpi which supports the appr. density of 213

When i set the tvdpi qualifier to the drawable folder i get "invalid resource directory name" error


回答1:


Resolution and dpi are not directly related. It just so happens that many 800x480 devices are HDPI, then can just as easily be low dpi though if the screen is big enough.

If you really need direct resolution matching you will need to target API level 13 and use available width and height qualifiers for your resources or if you need to target a lower API level than 13, create your own resource loading scheme.

You can also use a combination of density and size qualifiers but that still leaves some room for two different resolutions falling into the same bucket.

But before you pick, you need to ask yourself do you really want the same pixel size for your drawables on a 3.7" 480x800 screen as you do for a 7" 480x800 screen.



来源:https://stackoverflow.com/questions/7673676/android-multiscreen-support-issue

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