我如何创建一个4英寸不同的布局;和10 QUOT;在显示相同的分辨率? [英] How do I create different layouts for 4" and 10" displays at same resolution?
问题描述
根据这个文件的Android,支持多种屏幕的,好像是一个由4显示的图像在300PPI在320PPI屏幕也将通过10被利用,然而,同样的4所显示的布局在216ppi显示显示将有7共享。
作为参考,有些时下流行的Android设备:结果
的Nexus 4: 4.71280 * 768像素分辨率(320 ppi)计算结果
的Nexus 7: 71280×800(216ppi)结果
的Nexus 10: 10.0552560 x 1600的(300 PPI)
那么,如何实际提出具体的布局,包括艺术品为特定类型的设备?
例如单独的图像或布局:
在4布局的xhdpi图像
对于4布局的mdpid图像
在10布局的xhdpi图片
似乎由4上显示的图像在300PPI在320PPI屏幕也将通过一个10利用
块引用>在默认情况下,是的,只要两个设备将拉动来自同一
-xhdpi
资源集。他们都将在大约相同的物理尺寸呈现
由相同的4所显示的布局在216ppi显示显示将有7共享。
块引用>默认情况下,不,只要4显示器
- 正常
7显示器- 大
,使用旧集大小水桶,因此,如果你在这些目录中有不同的布局,每个设备都会使用适合该设备的布局。
那么,如何实际提出具体的布局,包括艺术品为特定类型的设备?
块引用>有关的布局,既可以使用传统的大小水桶(例如,
- 正常
,- 大
),或创建自己(例如,-sw600dp
)。有关绘图资源,通过把它们放在特定的密度桶开始(例如,
-mdpi
,-hdpi
,-xhdpi
)。如果你确定你有一个形象,在逻辑上是相同的,但你不希望使用相同的物理尺寸的影像上(在320PPI4画面也将有10所使用的相同密度的设备在300PPI ),你可以在大小设置资源融合预选赛以及(如RES /绘-大华电国际/
将上使用- 大
与-hdpi
密度)。According to this Android document, Supporting Multiple Screens, it seems that an image displayed by a 4" screen at 320ppi will also be utilized by a 10" at 300ppi, however, the layout displayed by the same 4" display will be shared with a 7" display at 216ppi.
For reference, some popular Android devices:
Nexus 4: 4.7" 1280 x 768 pixel resolution (320 ppi)
Nexus 7: 7" 1280x800 (216ppi)
Nexus 10: 10.055" 2560 x 1600 (300 ppi)So how does one practically make specific layouts, including artwork for a specific type of device?
For example separate images or layouts for: An xhdpi image on a 4" layout A mdpid image for a 4" layout An xhdpi image on a 10" layout
解决方案it seems that an image displayed by a 4" screen at 320ppi will also be utilized by a 10" at 300ppi
By default, yes, insofar as both devices will pull from the same
-xhdpi
resource set. They will both render at about the same physical size.the layout displayed by the same 4" display will be shared with a 7" display at 216ppi.
By default, no, insofar as 4" displays are
-normal
and 7" displays are-large
, using the old set of size buckets, and so if you have different layouts in those directories, each device will use the layout appropriate for that device.So how does one practically make specific layouts, including artwork for a specific type of device?
For layouts, either use the legacy size buckets (e.g.,
-normal
,-large
) or create your own (e.g.,-sw600dp
).For drawables, start by putting them in the density-specific buckets (e.g.,
-mdpi
,-hdpi
,-xhdpi
). If you determine that you have an image that logically is the same, but you do not want to use the same physical size image on the same density devices ("a 4" screen at 320ppi will also be utilized by a 10" at 300ppi"), you can blend in the size resource set qualifiers as well (e.g.,res/drawable-large-hdpi/
would be used on-large
devices with-hdpi
density).这篇关于我如何创建一个4英寸不同的布局;和10 QUOT;在显示相同的分辨率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!