Android 中的平板电脑布局 [英] Layout for tablets in Android
本文介绍了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?
推荐答案
我知道这是一个老问题,但为了它...根据文档,您应该像这样创建多个资产文件夹
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屋!
查看全文