开发者

Different resources for WVGA800 and WVGA854?

开发者 https://www.devze.com 2023-01-22 18:03 出处:网络
Got this really stupid problem: Can find the proper name for the android folder for WVGA800 resources.

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="tru开发者_JAVA技巧e"

android:normalScreens="true"

android:smallScreens="true"/>

Didnt solve the problem.

Is there a way to debug what resource folder is used and why?


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.


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.

0

精彩评论

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