布局在Android平板电脑 [英] Layout for tablets in Android

查看:135
本文介绍了布局在Android平板电脑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建不同的布局为Android平板电脑和手机。我应该在哪里放置布局资源,以使这种差异?

I would like to create different layouts for tablets and handsets in Android. Where should I put the layout resources in order to make this differentiation?

推荐答案

我知道这是一个老问题,但为了它... 据<一href="http://developer.android.com/guide/practices/screens_support.html#DeclaringTabletLayouts">documentation,你应该建立多发的资产文件夹,这样

I know this is an old question, but for the sake of it... According documentation, you should create mutiple asset folders like this

res/layout/main_activity.xml           # For handsets (smaller than 600dp available width)
res/layout-sw600dp/main_activity.xml   # For 7" tablets (600dp wide and bigger)
res/layout-sw720dp/main_activity.xml   # For 10" tablets (720dp wide and bigger)

这篇关于布局在Android平板电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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