简体   繁体   English

Android是否属于同一类别,但设备尺寸不同?

[英]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 51080 x 1920像素。 => layout-1080x1920 directory => layout-1080x1920目录

Nexus S is 480 x 800 pixels. Nexus S480 x 800像素。 => layout-480x800 directory (or just the default one) => layout-480x800目录(或仅是默认目录)

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

相关问题 不同尺寸的android设备中的相同图片尺寸 - Same picture size in different size of android devices 对于相同尺寸类别的设备,如何具有不同的布局? - How to have different layouts for same size category devices? 同一文件在不同的Android设备上的大小是否相同? - Is size for the same file identical on different Android devices? 以相同的密度和屏幕尺寸类别唯一标识设备,但以英寸为单位的屏幕尺寸不同 - Identify devices uniquely with same density and screen size category but different screen size in inches 如何在不同的Android设备上绘制相同物理尺寸的圆? - How to draw a circle of the same physical size on different Android devices? 如何在Android中的不同设备上保持相同的图像大小 - How to keep same image size on different devices in android Android WindowManager在不同设备上显示相同的屏幕尺寸 - Android WindowManager shows same screen size for different devices Android:在图片资源上书写并在不同设备上保持相同大小 - Android: write on an image resource and keep the same size on different devices Android Studio在不同设备上的图片大小不同 - Android Studio different picture size on different devices App安装的大小在Android设备上有所不同 - App installed size is different on different devices Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM