屏幕方向更改时的旋转视图(但不更改布局) [英] Rotating Views (but not Layouts) on screen orientation change

查看:90
本文介绍了屏幕方向更改时的旋转视图(但不更改布局)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想旋转Buttons/TextViews/etc.屏幕方向改变,但我想保持布局不变.怎么做到呢?我正在使用LinearLayouts.

I would like to rotate Buttons/TextViews/etc. on screen orientation change but I want to keep layout unchanged. How can it be done? I'm using LinearLayouts.

这是我的意思:

推荐答案

创建res->layout->layout-land并将您的xml文件放置为横向 模式

Create res->layout->layout-land and put your xml file for landscape mode

layout文件夹中的布局文件仅用于纵向模式.现在,如果需要横向,请创建layout-land文件夹.

Your layout file in layout folder is only for portrait mode Now if you need landscape then create layout-land folder.

这篇关于屏幕方向更改时的旋转视图(但不更改布局)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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