支持的Android平板电脑都 - 分类可绘制和布局 [英] Android supporting all tablets - categorize drawables and layouts
问题描述
我见过许多线程在计算器讨论这个问题(如<一个href="http://stackoverflow.com/questions/9093194/supporting-all-android-tablets-resolutions">this, <一href="http://stackoverflow.com/questions/6148420/android-layouts-drawables-and-resolution-what-is-the-best-way">this和<一href="http://stackoverflow.com/questions/10293436/android-layouts-design-for-tablets-and-devices">this),我读过关于支持多屏幕的文档,并设计了。但是,我还是不清楚的可绘文件夹结构和布局不同屏幕
I have seen many thread discussing this problem in stackoverflow (like this, this and this), and I have read the documentation about supporting multiple screens, and designs. But I am still not clear about the folder structure for drawables and layout for different screens
我工作的支持android手机和平板电脑的应用程序。而我的项目表现出一些图像,这需要显示在良好的品质在所有可能的Android设备。而且我要告诉我的设计师来设计,所有这些解决方案。
I am working on an app that support android phone and tablets. And my project showing some images, which need to be shown in good quality in all possible android devices. And I need to tell my designer to design for all these resolutions.
从文档看来我应该如下决议增加可绘制(绘制文件夹的名称被赋予底),
From the documentation it seems I should add drawables for following resolutions (drawable folder name is given at the end),
1) 240 x 320 - Phone LDPI -> drawable-ldpi
2) 320 x 480 - Phone MDPI -> drawable-mdpi
3) 480 x 800 - Phone HDPI -> drawable-hdpi
//Now for tablets
4) 1024x600 - Tablet LDPI -> ??
5) 1280x800 - Tablet MDPI -> ??
6) 1536x1152 - Tablet HDPI -> ??
7) 2560x1600 - Tablet XHDPI-> ??
从支持多屏文档,看来我可以用文件夹像
From supporting multiple screens documentation, it seems I can use folders like
1) drawable-sw600dp ( a 7" tablet (600x1024 mdpi).)
2) drawable-sw720dp (a 10" tablet (720x1280 mdpi, 800x1280 mdpi, etc).
但对于平板电脑与在1536x1152,2560x1600的范围决议等10'的分辨率范围内(720×1280等)似乎小,他们..我的客户拥有的Nexus 10,分辨率2560×1600,我想我的应用程序,以完美的外观就可以了。
But what about tablets with resolutions in the range of 1536x1152, 2560x1600 etc.. the 10' resolution range (720 x 1280 etc)seems small for them.. My client has a Nexus 10 with resolution 2560×1600 and I want my app to look perfect on it..
我知道,九片图像,布局使用 WRAP_CONTENT
并像其他的好的做法。但对于这个项目,我有,按照规定,应被视为对所有常见的屏幕拉泽锐利一些图片,我需要至少在我包几个版本的图像。
I know about, nine patch images, layout using wrap_content
and other good practices like that. But for this project, I have some images which, as per requirement, should be seen lazer sharp on all common screens, and I need several versions of those images at least in my bundle.
那么,我应该提什么决议的设计师?我怎样才能加以分类捆绑提供正确的文件夹名。
So what and what resolutions should I mention to the designer? And how can I categorize them in bundle giving correct folder name.
推荐答案
其实片中按大小分类不dpi时,IE 7选项卡绘制大型
,而你10选项卡绘制-XLARGE
。现在你可以通过DPI再次分类,比如绘制-大华电国际
这意味着它是一个选项卡7,它具有高密度。
Actually Tablets are categorized by size not by dpi, i.e 7" tab is drawable-large
while your 10" tab is drawable-xlarge
. And now you can again categorized by dpi like drawable-large-hdpi
which means it is a Tab of 7" which having High Density.
您可以使用软件
最小宽度的概念为目标的信息,请参阅<一href="http://stackoverflow.com/questions/12242111/application-skeleton-to-support-multiple-screen">Application骷髅支持多屏,并计算相同。
you can use SW
smallest width concept to target that, see Application Skeleton to support multiple screen and make calculation for the same.
平板片剂分为两种尺寸
7(1024×(600-48(导航栏)))= 1024×552(绘制大型)
10(1280X(800-48(导航栏)))= 1280×752(绘制-XLARGE)
7" (1024X(600-48(navigation bar))) = 1024 X 552 (drawable-large)
10" (1280X(800-48(navigation bar))) = 1280 X 752 (drawable-xlarge)
和为2560x1600的计算SW送与公式
and for 2560x1600 calculate SW dp with formula
PX =设备的宽度
DPI =设备的密度
px= Device's width
dpi= Device's density
公式给出
px = dp * (dpi / 160)
交换的公式,如果你有PX的价值
interchange formula if you have px's value
dp = px / (dpi / 160)
所以绘制-swxxxdp将做的工作。
so drawable-swxxxdp will do the job
这篇关于支持的Android平板电脑都 - 分类可绘制和布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!