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)
Android 与 iPhone 不同。在 iPhone 中,它可以为两种受支持的分辨率制作全屏图像,并依赖于此。在 Android 中,它不起作用。有太多的决议,而且一周中的任何一天都可能有更多的决议出现。那么,解决方案就是真正使布局和图像设备独立。有时这需要创造性的解决方案,但无论如何都需要改变思维。
例如,我们试图为全屏启动页面解决同样的问题。我们在图片底部有一个徽标、一个渐变和一组对象。我们的解决方案是将这三件事分开,允许拉伸渐变,然后将徽标放置在中心,将对象放置在底部。这是 Android 中所需的解决方案类型,它将使您不必为每种分辨率剪切不同的图形。
您还可以尝试使用九块图像来实现其中一些。除了图像包含渐变这一事实之外,这对于我们的情况来说非常有用。
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.
一切似乎都是正确的,除了你犯了一个拼写错误:“drawble”。检查您的目录名称。
我建议您首先尝试更宽松的资源过滤器。将您的资源分为
drawable-long
和drawable-notlong
,然后看看它是否有效。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
anddrawable-notlong
, and see if it works.