Bry*_*eld 120 resources layout android orientation android-layout
如何为横向设置一个布局,为纵向设置一个?当用户将手机侧向旋转时,我想假设额外的宽度并节省垂直空间.
mar*_*pet 214
默认情况下,布局/res/layout
适用于纵向和横向.
如果你有例如
/res/layout/main.xml
Run Code Online (Sandbox Code Playgroud)
您可以添加新文件夹/res/layout-land
,复制main.xml
到其中并进行必要的调整.
另请参阅http://www.androidpeople.com/android-portrait-amp-landscape-differeent-layouts和http://www.devx.com/wireless/Article/40792/1954以获取更多选项.
Ree*_*ing 72
在当前版本的Android Studio(v1.0.2)中,您只需单击下面屏幕截图中显示的可视化编辑器中的按钮即可添加横向布局.选择"创建景观变化"
Fastest way for Android Studio 3.x.x and Android Studio 4.x.x
1.Go to the design tab of the activity layout
2.At the top you should press on the orientation for preview button, there is a option to create a landscape layout (check image), a new folder will be created as your xml layout file for that particular orientation
归档时间: |
|
查看次数: |
164230 次 |
最近记录: |