布局在Android平板电脑平板、布局、电脑、Android

2023-09-12 01:27:25 作者:眼眸里印不出柔情

我想创建不同的布局为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?

推荐答案

我知道这是一个老问题,但为了它... 据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)