Different resources for WVGA800 and WVGA854?

跟風遠走 提交于 2019-12-04 16:01:55

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.

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