Android图片属于什么drawable文件夹?

发布于 2024-12-13 12:53:48 字数 491 浏览 2 评论 0原文

我读过有关 dpi 和支持 Android 中的多个屏幕的内容,但仍然不明白:(

事实:我有一个大小为 480*800 像素的背景 spalsh 图像。

问题:我应该在哪个文件夹中放置它?drawable-what?

旁注:我尝试将其放入drawable-hdpi,但是当我在drawable-land-xhdpi和drawable-port-xhdpi中添加更大尺寸的图像时, Android 选择了更大的。 奇怪的是,这是在具有 480*800 像素尺寸屏幕的 Nexus S 上进行测试的。 Android 没有理由使用更大尺寸的图像!

编辑:这是一个带有具体示例的通用问题。通用问题:假设您有一组具有不同分辨率的图像,代表相同的含义。它们应该填满整个屏幕。 您将每个文件夹放在哪个文件夹中?

I read about dpi and supporting multiple screens in Android and still don't get it :(

Fact: I have a background spalsh image sized 480*800 pixels.

Questions: In what folder should I put it? drawable-what?

Side note: I tried putting it in drawable-hdpi, but when I added larger sized images, in drawable-land-xhdpi and drawable-port-xhdpi, Android chose to take the bigger ones instead.
The weird part is that this is tested on a Nexus S which has a 480*800 pixel size screen. No reason for Android to use a larger sized image!!!

Edit: This is a generic question with a specific example. The generic question: consider you have a set of images with different resolutions, representing the same meaning. They should fill the whole screen. In what folder do you put each?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

溺ぐ爱和你が 2024-12-20 12:53:48

hdpi 是“高密度”。 通常这意味着 480*800。这种情况下的虚拟屏幕将为 320*480。

我怀疑你想要做的是将启动图像放入drawable-hdpi中。您的手机将自己视为 hdpi 设备,因此它将首先在该文件夹中查找指定资源。如果它在那里找到它,它就会使用它。如果没有,它将在其他可绘制文件夹中查找。

您可能没有 xhdpi 设备。 AFAIK,唯一推出的是 Nexus Galaxy。有些平板电脑可能是 xhdpi,但也可能不是。 hdpi/xhdpi 指的是密度,而不是尺寸。

所以,把它放在drawable-hdpi中。您应该在 atrix 和 bionic 等具有更高分辨率的手机上测试您的应用程序,但我认为仍然是 hdpi 屏幕。您的启动画面可能不会像您希望的那样好,但仍应发挥作用。

hdpi is "high density". Generally that means 480*800. The virtual screen in this situation would be 320*480.

What I suspect you want to do is put that splash image in drawable-hdpi. Your phone considers itself an hdpi device, so it will look in that folder first for the named resource. If it finds it there, it will use it. If it does not, it will look in other drawable folders.

Chances are, you don't have an xhdpi device. AFAIK, the only one coming out is the Nexus Galaxy. Some tablets are POSSIBLY xhdpi, but probably not. hdpi/xhdpi refer to the density, not the size.

So, put it in drawable-hdpi. You should test your app on phones like the atrix and bionic, that have higher resolutions, but I think are still hdpi screens. Your splash probably won't look as good as you'd like it to, but should still function.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文