Android XML設置屏幕方向(android:screenOrientation)详解
作者:lqh 时间:2021-09-08 09:46:35
Android XML設置屏幕方向(android:screenOrientation)详解
注意:Android只支持270度旋转。
<activity android:name=".MyActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
android:screenOrientation设定该活动的方向, 该值可以是任何一个下面的字符串:
"unspecified"
- 默认值. 由系统选择显示方向. 在不同的设备可能会有所不同.
"landscape"
- 橫向
"portrait"
- 纵向
"user"
- 用戶当前的首选方向
"behind"
- 与在活动堆栈下的活动相同方向
"sensor"
- 根据物理方向传感器确定方向. 取决于用戶手持的方向, 当用戶转动设备, 它跟隨改变.
"nosensor"
- 不经物理方向传感器確定方向. 该传感器被忽略, 所以当用戶转动设备, 显示不會跟隨改变. 除了这个区别,系統选择使用相同的政策取向对于“未指定”设置. 系統根据“未指定”("unspecified")设定选择相同显示方向.
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
来源:http://blog.csdn.net/zeng622peng/article/details/6572115
标签:Android,XML,設置屏幕
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
java中常见的死锁以及解决方法代码
2023-04-07 19:47:30
![](https://img.aspxhome.com/file/2023/2/64422_0s.png)
Java深入探究关键字abstract的使用
2023-08-03 07:48:20
Android编程中activity启动时出现白屏、黑屏问题的解决方法
2023-03-09 06:15:03
Java分布式事务管理框架之Seata
2023-09-28 11:50:36
![](https://img.aspxhome.com/file/2023/1/63731_0s.png)
C#正则表达式大全
2023-12-04 13:06:37
使用注解@Validated和BindingResult对入参进行非空校验方式
2022-09-16 11:30:44
![](https://img.aspxhome.com/file/2023/5/66215_0s.png)
Java swing 图像处理多种效果实现教程
2022-08-16 20:15:08
![](https://img.aspxhome.com/file/2023/0/77960_0s.jpg)
Android OkHttp代理与路由的彻底理解
2023-03-17 01:21:51
![](https://img.aspxhome.com/file/2023/2/130452_0s.jpg)
C# 读写XML文件实例代码
2023-04-01 03:40:58
Android学习笔记--使用剪切板在Activity中传值示例代码
2022-12-21 13:43:58
Java Servlet线程中AsyncContext异步处理Http请求
2023-10-02 23:17:39
![](https://img.aspxhome.com/file/2023/9/110889_0s.png)
C#接口(Interface)用法分析
2022-10-18 10:59:17
Java swing五子棋的实现方法
2021-06-01 15:25:20
![](https://img.aspxhome.com/file/2023/0/69890_0s.jpg)
feign 如何获取请求真实目的ip地址
2021-08-13 15:47:49
![](https://img.aspxhome.com/file/2023/1/76281_0s.jpg)
c#.net多线程编程教学——线程同步
2021-12-27 06:03:50
Java中用enum结合testng实现数据驱动的方法示例
2021-08-04 07:44:21
![](https://img.aspxhome.com/file/2023/9/65179_0s.png)
mybatis-generator自动生成dao、mapping、bean配置操作
2023-08-17 14:05:30
![](https://img.aspxhome.com/file/2023/8/57838_0s.jpg)
Android开发之DrawerLayout实现抽屉效果
2023-09-30 03:40:59
![](https://img.aspxhome.com/file/2023/5/85975_0s.png)
Spring注解驱动之BeanPostProcessor后置处理器讲解
2023-01-04 17:13:26
Android编程实现类似天气预报图文字幕垂直滚动效果的方法
2022-08-02 08:16:50
![](https://img.aspxhome.com/file/2023/9/122119_0s.gif)