简体   繁体   English

如何为Nexus 4和类似设备创建不同的布局? (Galaxy S4)

[英]How to create different layout for Nexus 4 and similar devices? (Galaxy S4)

The question is how create a specific layout for Nexus 4 and similar devices? 问题是如何为Nexus 4和类似设备创建特定的布局?

4.7" diagonal 1280 x 768 pixel resolution (320 ppi) WXGA IPS 4.7英寸对角线1280 x 768像素分辨率(320 ppi)WXGA IPS

For Nexus 4 should load the same layout that Galaxy S3 对于Nexus 4,应加载与Galaxy S3相同的布局

Galaxy S3 Screen Size: 4.8 inch Screen Resolution: 1,280 x 720 pixels Galaxy S3屏幕尺寸:4.8英寸屏幕分辨率:1,280 x 720像素

And the configuration should be: 配置应该是:

  1. For same layout landscape and portrait layout-sw360dp 对于相同的布局横向和纵向布局-sw360dp
  2. Only for landscape layout-sw360dp-land 仅适用于横向布局-sw360dp-land
  3. Only for portrait layout-sw360dp-port 仅适用于纵向布局-sw360dp-port

Other similar devices: 其他类似设备:

  • LG Optimus 4X HD LG Optimus 4X HD
  • HTC One X+ HTC One X +

For Galaxy S4 should also compatible and load this layout 对于Galaxy S4也应兼容并加载此布局

The response was in this entry: Android S3 layout vs Galaxy Nexus layout 响应在此条目中: Android S3布局与Galaxy Nexus布局

You can create layout directories for specific combinations. 您可以为特定组合创建布局目录。 For 7" 1280 x 768 at 320 ppi it will look something like this: 对于7“1280 x 768,320 ppi,它看起来像这样:

layout-sw600p-xdpi-large

As @Tomer Mor mentioned, you can find a full list of available parameters here 正如@Tomer Mor所提到的,您可以在此处找到可用参数的完整列表

Also, if you want to be even more specific about device parameters, take a look at this question - you can assign different layouts from code, depending on the environment. 此外,如果您想更加具体地了解设备参数,请查看此问题 - 您可以根据环境从代码中分配不同的布局。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM