Android应用:支持所有的屏幕尺寸 [英] Android app: Support all screen sizes

查看:140
本文介绍了Android应用:支持所有的屏幕尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 有四种尺寸屏幕,小,中,大和XLARGE。因此,这些限定词对应于特定的屏幕。例如,在正常限定符是一个3.7英寸屏幕和小是一个2.7英寸屏幕。那么,是什么与其他尺寸会发生什么?如何我的应用程序包括其他尺寸,如3.3英寸或3.2英寸例如?

According to this there are four size screens, small, normal, large and xlarge. So these qualifiers correspond on specific screens. For example, normal qualifier is a 3.7inches screen and small is a 2.7inches screen. So, what happens with the others sizes? How does my app cover other sizes, like 3.3inches or 3.2inches for example?

推荐答案

你提到的屏幕尺寸,目的是要范围。例如,3.3英寸的屏幕可能会落入正常的类别的,因为它是大于2.7,但小于3.7。现在说,有在像素密度方面的一些细微的变化,而这样的事情,但他们选择了屏幕尺寸背后的想法是,有没有一个整体相差很多了一块3.2英寸的屏幕和一个3.3英寸的屏幕之间,因此,如果您正确填写您的布局(使用相对宽度等),那么您的应用程序应该是相同的不管你是在3.2或3.3。他们在所有的大小的SDK增加的原因是,你可能希望有更多的显示信息,或者有事情布局有所不同,如果你的消费者使用的是真正的小屏幕VS一个真正的大单(如平板电脑)。在大多数情况下,但是,相对布局的国王 - 不使用硬codeD像素值的视图元素的大小,如果你能避免它,并保持你的布局流体 - 这样所有的屏幕尺寸可以用最少的支持工作和测试你的一部分。

The screen sizes you mentioned are meant to be ranges. For instance, a 3.3 inch screen would probably fall into the 'normal' category , as it is bigger than the 2.7, but less than 3.7. now that said, there are some minor changes in terms of pixel density and that kind of thing, but the idea behind the screen sizes they chose is that there isn't a whole lot of difference between a 3.2 inch screen and a 3.3 inch screen, so if you write your layout properly (using relative widths, etc.) then your app should look the same whether you are on a 3.2 or 3.3. The reason they add in all those sizes for the SDK is that you might want to have more information shown or have things laid out differently if your consumer is using a really small screen vs a really large one (like a tablet). For the most part, however, relative layouts are king - don't use hard coded pixel values for sizing of view elements if you can avoid it, and keep your layout fluid - that way all screen sizes can be supported with minimal work and testing on your part.

这篇关于Android应用:支持所有的屏幕尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆