我是否需要14种不同的布局,支持所有Android设备? [英] Do I need 14 different layouts to support all Android devices?

查看:85
本文介绍了我是否需要14种不同的布局,支持所有Android设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的感到困惑。从文档在developer.android.com,似乎为了保住我的图片正确缩放跨我需要下面的所有这些布局,目前所有的Andr​​oid设备(宽高比太)。是不是真的是每个人都在做什么?我缺少的东西,或者我应该会对此以不同的方式?

 低密度小屏幕QVGA 240×320
------------------------------------------------
布局小LDPI
布局小土地LDPI

低密度标准屏幕WVGA400 240X400(X432)
------------------------------------------------
布局LDPI
布局土地LDPI

中密度标准屏幕分辨率320x480的HVGA
------------------------------------------------
布局MDPI
布局土地MDPI

中密度大屏幕HVGA小320x480
------------------------------------------------
布局大MDPI
布局大陆MDPI

高密度标准屏幕WVGA800 480×800(x854)
------------------------------------------------
布局华电国际
布局土地华电国际

Xoom的(中密度大,但1280x800的水库)
------------------------------------------------
布局XLARGE
布局XLARGE陆
 

解决方案

是的,当然,Android的开发者和虐待狂一样通过创建14布局的痛苦!

说真的,你的应用程序将工作与经典的布局设备的100%。

您可以再补充一些按钮或通过添加一些预选赛改变在横向模式下的布局,但是这是给你的!

例如,在LDPI(小分辨率)设备,您可能需要调整一些按钮或改变一点点,以适应小屏幕。

您可能还需要提上了正确的在横向模式和纵向布局底部的一些按钮!

您没有不得不使用他们。

I'm really feeling confused. From the docs at developer.android.com, it seems in order to keep my images scaled correctly (aspect ratio too) across all current Android devices I need all these layouts below. Is that really what everyone is doing? Am I missing something, or should I be going about this a different way?

Low density Small screens QVGA 240x320
------------------------------------------------
layout-small-ldpi
layout-small-land-ldpi

Low density Normal screens WVGA400 240x400 (x432)
------------------------------------------------
layout-ldpi
layout-land-ldpi

Medium density Normal screens HVGA 320x480
------------------------------------------------
layout-mdpi
layout-land-mdpi

Medium density Large screens HVGA 320x480
------------------------------------------------
layout-large-mdpi
layout-large-land-mdpi

High density Normal screens WVGA800 480x800 (x854)
------------------------------------------------
layout-hdpi
layout-land-hdpi

Xoom (medium density large but 1280x800 res)
------------------------------------------------
layout-xlarge
layout-xlarge-land

解决方案

Yes of course, Android developers are sadist and like suffering by creating 14 layouts!

Seriously, your app will work on 100% of the devices with the classic layout.

You can just add some buttons or change the layout in landscape mode by adding some qualifiers but that's up to you!

For instance, on LDPI (small resolution) device, you may want to adjust some buttons or change a little bit to fit the small screen.

You may also want to put some buttons on the right in landscape mode and in the bottom of your layout in portrait!

You do not "have to" use them.

这篇关于我是否需要14种不同的布局,支持所有Android设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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