android:screenOrientation属性
来源:互联网 发布:洗衣烘干一体机 知乎 编辑:程序博客网 时间:2024/05/29 17:05
在开发android的应用中,有时候需要限制横竖屏切换。只需要在AndroidManifest.xml文件中加入android:screenOrientation属性限制。
Android:screenOrientation设定该活动的方向,该值可以是任何一个下面的字符串:
"unspecified"
- 默認值. 由系統選擇顯示方向. 在不同的設備可能會有所不同.
"landscape"
- 橫向
"portrait"
- 縱向
"user"
- 用戶當前的首選方向
"behind"
- 與在活動堆棧下的活動相同方向
"sensor"
- 根據物理方向傳感器確定方向. 取決於用戶手持的方向, 當用戶轉動設備, 它跟隨改變.
"nosensor"
- 不經物理方向傳感器確定方向. 該傳感器被忽略, 所以當用戶轉動設備, 顯示不會跟隨改變. 除了這個區別,系統選擇使用相同的政策取向對於“未指定”設置. 系統根據“未指定”("unspecified")設定選擇相同顯示方向.
如果要使Activity的View界面全屏,只需要将最上面的信号栏和Activity的Title栏隐藏掉即可,隐藏Title栏的代码:
0 0
- android:screenOrientation属性
- android screenOrientation属性
- Android screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性
- android:screenOrientation属性限制
- Git搭建本地服务器
- MFC中定时器使用实例
- remind 一个问号两小时 :)
- muduo-源码分析2:注册监听socket和建立连接
- Openstack Ocata安装(Identity service)
- android:screenOrientation属性
- 二叉树操作合集(陆续更新)
- 编程总结
- 文章标题
- more命令
- centeros 安装 ssh
- delphi xe 解析复杂json
- 将二叉树拆成链表
- 自定义iOS7导航栏背景,标题和返回按钮文字颜色