简体   繁体   English

根据屏幕分辨率使用适当的布局标记

[英]Using appropriate layout markup according to screen resolution

I've got a design list for 480x800, 1024x600, 1280x800. 我有一个480x800、1024x600、1280x800的设计列表。 How do I ask android to use exact markup based on user screen's resolution ? 如何要求android根据用户屏幕的分辨率使用确切的标记? As far as I know there're only abstract means(hdpi,xdpi) for solving resolution difference. 据我所知,只有抽象方法(hdpi,xdpi)用于解决分辨率差异。

How do I ask android to use exact markup based on user screen's resolution ? 如何要求android根据用户屏幕的分辨率使用确切的标记?

Talented developers don't do that. 有才华的开发人员不会这样做。 Talented developers realize that only a percentage of Android devices run at the resolutions listed above, just as desktop Web browsers do not run at only three window sizes. 有才华的开发人员意识到,只有一部分Android设备以上述列出的分辨率运行,就像台式机Web浏览器并非仅以三种窗口大小运行一样。 Talented developers work with the graphics designer to come up with fluid layouts for different screen sizes (eg, -normal , -large , -xlarge ), which may or may not run at the aforementioned resolutions. 优秀的开发与图形设计师合作,来为不同的屏幕尺寸流体布局(例如, -normal-large-xlarge ),这可能会或可能不会在上述的分辨率下运行。 For example, there are devices with screen sizes ranging from 4" to 7" that run at 800x480, and there are devices with screen sizes from 4.5" to 10.1" running at 1280x800 (or thereabouts). 例如,有些设备的屏幕尺寸在4“到7”之间,运行速度为800x480,有些设备的屏幕尺寸在4.5“到10.1”之间,其运行速度为1280x800(或其附近)。

As far as I know there're only abstract means(hdpi,xdpi) for solving resolution difference. 据我所知,只有抽象方法(hdpi,xdpi)用于解决分辨率差异。

-hdpi and -xhdpi have nothing to do with screen resolution. -hdpi-xhdpi与屏幕分辨率无关。 They are for screen density. 它们用于屏幕密度。 Density is independent of resolution, and density is largely independent of size. 密度与分辨率无关,密度在很大程度上与尺寸无关。

Create folder based screen width or height. 创建基于文件夹的屏幕宽度或高度。 For example 例如

res/layout-w480dp, res/layout-w1024dp, res/layout-w1280dp 分辨率/布局-w480dp,分辨率/布局-w1024dp,分辨率/布局-w1280dp

Or 要么

res/layout-h800dp, res/layout-h600dp 分辨率/布局-h800dp,分辨率/布局-h600dp

Read more here , Table 2. Configuration qualifier names. 在这里 ,表2了解更多。配置限定符名称。

Afaik, you can markup the layout folder by that is the minimum required screen resolution for the layout you can set one to min600 and one to min 800. Afaik,您可以标记布局文件夹,这是该布局所需的最低屏幕分辨率,您可以将其设置为min600,将其设置为min 800。

I think this markup scheme is supported in honeycomb and above and since these are tablets resolutions, they will have either anyway. 我认为此标记方案在蜂窝及以上版本中受支持,并且由于这些是平板电脑的分辨率,因此无论如何都会有。

see this and this 看到这个这个

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

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