Different resources for WVGA800 and WVGA854?

我的未来我决定 提交于 2020-01-01 18:55:35

问题


Got this really stupid problem:
Can find the proper name for the android folder for WVGA800 resources.

I've created a folder for WVGA854: drawable-normal-long-hdpi
It worked totally fine.
For WVGA800 I've tried 'drawable-normal-notlong-hdpi' - emulator and handset still gets resources from
'drawable', not even 'drawable-normal-long-hdpi'.
Tried using 'drawble-hdpi', 'drawable-notlong-hdpi' - nothing works, it keeps using 'drawable' for resources.

How should the folder for WVGA800 be named?

UPD:
Using
supports-screens android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"/>
Didnt solve the problem.
Is there a way to debug what resource folder is used and why?


回答1:


Android is not like the iPhone. In iPhone it works to make full-screen images for the two supported resolutions, and rely on that. In Android, it doesn't work. There are too many resolutions, and more can come out any day of the week. The solution, then, is to really make the layouts and images device independent. Sometimes this requires creative solutions, but in any case it requires a change in thinking.

For example, we were trying to solve this same problem for a full-screen splash page. We had a logo, a gradient, and a set of objects at the bottom of the picture. The solution for us was to split these three things, allow the gradient to be stretched, and then position the logo in the center, and the objects at the bottom. This is the type of solution that is required in Android, and it will save you from having to cut a different graphic for every resolution.

You can also try nine-patch images for some of this. This would have worked great for our case except for the fact that the image included a gradient.




回答2:


All seems correct, except you did a spelling mistake: "drawble". Check your directory names.

I suggest you try a more permissive resource filter first. Separate your assets in drawable-long and drawable-notlong, and see if it works.



来源:https://stackoverflow.com/questions/4050390/different-resources-for-wvga800-and-wvga854

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