qHD 分辨率的绘图
我正在设计一款可能适用于各种 Android 设备的游戏,因此我有多个适用于不同分辨率的手机和平板电脑的可绘制文件夹。这是我的文件夹列表:
- drawable-mdpi - 适用于 480x320 设备
- drawable-hdpi - 适用于 800x480 和 854x480 设备
- drawable-large-hdpi - 适用于 1024x600 平板电脑
- drawable-xlarge-mdpi - 适用于 1200x800 平板电脑
我的问题是名称应该有包含用于 qHD 分辨率的绘图的文件夹,即960x540 和 256 dpi?提前致谢。
I'm designing a game possibly for all kinds of Android devices, so I have multiple drawable folders for phones of different resolutions, and for tablets. Here is the list of my folders:
- drawable-mdpi - for 480x320 devices
- drawable-hdpi - for 800x480 and 854x480 devices
- drawable-large-hdpi - for 1024x600 tablets
- drawable-xlarge-mdpi - for 1200x800 tablets
My question is what name should have a folder with drawables for qHD resolution, which is 960x540 and 256 dpi? Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会强烈、强烈、强调地鼓励您不要对可绘制对象使用“-large”或“-xlarge”限定符。如果你这样做,几乎可以肯定你并没有按照你的想法去做。
例如。
“drawable-large-hdpi”并不意味着“1024x600 平板电脑”。这意味着 HDPI 屏幕被归类为大屏幕。有大量的屏幕尺寸适合此类别。事实上,您很快就会看到 1024x600 mdpi 平板电脑。
并且“drawable-xlarge-mdpi”并不意味着“1200x800 平板电脑”。首先,像 Xoom 这样的平板电脑实际上是 1280x800。其他可能的分辨率包括 1280x720、960x720、1920x1200 等等。
如果您正在做这种事情,我建议:只需编写一些代码即可。如果您想要选择一组可绘制对象来最匹配 UI 中的可用空间,请编写一些代码来查看可用空间并选择一个可绘制对象。当您执行此操作时,请勿使用 Display.getDisplayMetrics()。根据实际分配给视图层次结构中相应视图的空间来实现此操作。
话虽如此,qHD 屏幕通常是 hdpi 正常尺寸。
所以,另一个例子:“drawable-hdpi”与分辨率根本没有任何关系。您将在此处看到可能的分辨率:800x480、640x480、960x540 等等。
\
I will deeply, strongly, emphatically encourage you not to use "-large" or "-xlarge" qualifiers with drawables. If you are doing this, you are almost certainly not doing what you think you are.
For example.
"drawable-large-hdpi" does not mean "1024x600 tablets." It means an hdpi screen that is classified as large. There are a huge number of screen sizes that fit in this category. In fact you will soon be seeing 1024x600 mdpi tablets.
And "drawable-xlarge-mdpi" does not mean "1200x800 tablets." First of all, tablets like the Xoom are actually 1280x800. And other possible resolutions here are 1280x720, 960x720, 1920x1200, and on and on and on.
If you are doing this kind of thing, let me suggest: just write some code instead. If you have a set of drawables that you want to pick to best match the space you have available in your UI, write some code that looks at the space it has available and picks a drawable. And when you do this, don't use Display.getDisplayMetrics(). Implement this based on the space actually given to your appropriate view in the view hierarchy.
Now all that said, qHD screens are generally hdpi normal size.
So, another example: "drawable-hdpi" doesn't have anything to do with a resolution at all. Possible resolutions you will see here: 800x480, 640x480, 960x540, and on and on.
\