[英]Android same category but different size devices?
I'm developing an android app. 我正在开发一个android应用程序。 I've done much so far, but I've some problems. 到目前为止,我已经做了很多工作,但是有一些问题。 So far, I've compiled the app on Nexus 5 and I've designed the layout for that device. 到目前为止,我已经在Nexus 5上编译了该应用,并为该设备设计了布局。 I know that, I should have different layout folders for different screen categories, but my problem is that, for example, my app works pretty good on Nexus 5, but not good on Nexus S . 我知道我应该为不同的屏幕类别使用不同的布局文件夹,但是我的问题是,例如,我的应用程序在Nexus 5上运行良好,但在Nexus S上运行不佳。
And I also know that those 2 devices are in the same layout category. 而且我也知道那两个设备属于同一布局类别。
How can I solve this issue? 我该如何解决这个问题? I want a layout for Nexus S which differs Nexus 5. 我想要与Nexus 5不同的Nexus S布局。
Note: Please, do not comment documentation links. 注意:请不要评论文档链接。 I've read them all, but couldn't solve my problem. 我已经阅读了所有内容,但无法解决我的问题。
Thanks! 谢谢!
From official documentation : 根据官方文件 :
- ldpi (low) ~120dpi ldpi(低)〜120dpi
- mdpi (medium) ~160dpi mdpi(中)〜160dpi
- hdpi (high) ~240dpi hdpi(高)〜240dpi
- xhdpi (extra-high) ~320dpi xhdpi(超高)〜320dpi
- xxhdpi (extra-extra-high) ~480dpi xxhdpi(超高)〜480dpi
- xxxhdpi (extra-extra-extra-high) ~640dpi xxxhdpi(超高)〜640dpi
Using desnity: 使用目的:
Nexus 5 is ~445 dpi => belong to xhdpi
category. Nexus 5 约为445 dpi =>属于xhdpi
类别。
Nexus S is ~233 dpi => belong to mdpi
category. Nexus S为〜233 dpi =>属于mdpi
类别。
So you can use layout-xhdpi
directory for Nexus 5 , and layout-mdpi
directory for Nexus S . 因此,您可以对Nexus 5使用layout-xhdpi
目录,对Nexus S使用 layout-mdpi
目录。
UPDATE 更新
Using dimensions: 使用尺寸:
Nexus 5 is 1080 x 1920 pixels. Nexus 5为1080 x 1920像素。 => layout-1080x1920
directory => layout-1080x1920
目录
Nexus S is 480 x 800 pixels. Nexus S为480 x 800像素。 => layout-480x800
directory (or just the default one) => layout-480x800
目录(或仅是默认目录)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.