简体   繁体   English

如何在Android中支持不同的屏幕

[英]How to support different screens in android

After reading the documentation provided here , i felt its better to use DP for all the pixels we declare it in layout file, But doing like this work for all different screen sizes.? 阅读了此处提供的文档后,我觉得最好将DP用于我们在布局文件中声明的所有像素,但是对于所有不同的屏幕尺寸都可以这样做。

For eg: lets take galaxy phones of samsung and xperia neo phone. 例如:让我们拿三星的星系手机和xperia neo手机。 Galaxy phone is broader in width but xperia is smaller in width. Galaxy手机的宽度较宽,但xperia的宽度较小。 so in this case how android will adjust the layout?. 所以在这种情况下android将如何调整布局? How to handle these kind of senarios 如何处理这类senarios

Using dps is basically like designing in inches- 1 dp is 1/160th of an inch. 使用dps基本上就像以英寸为单位进行设计-1 dp是1/160英寸。 Android won't adjust anything, it will do things just as you say- in physical units. Android不会进行任何调整,它将按照您所说的以物理单位进行操作。 If that means things go off the screen or you have empty space on the screen, Android won't care. 如果那意味着屏幕上的东西消失了,或者屏幕上没有可用空间,则Android不会在乎。

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

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