android:screenOrientation属性
来源:互联网 发布:知柏地黄丸吃多久为好 编辑:程序博客网 时间:2024/04/30 15:39
注:原文转自:http://blog.csdn.net/nmgchfzhzhg/article/details/8077133
</pre><h3 style="margin: 0px 0px 0.5em; padding: 10px 0px 0px; line-height: 1.5em; font-family: Verdana; font-size: 16px;"><span style="font-size: 12px; line-height: 18px;">在开发android的应用中,有时候需要限制横竖屏切换。只需要在AndroidManifest.xml文件中加入android:screenOrientation属性限制。</span></h3><p style="margin-top: 0px; margin-bottom: 0.5em; padding-top: 10px; padding-bottom: 0px; line-height: 1.5em; font-family: Verdana; font-size: 16px;"> </p><pre name="code" class="java">android:screenOrientation="landscape"是限制此页面横屏显示,android:screenOrientation="portrait"是限制此页面数竖屏显示。
Android:screenOrientation设定该活动的方向,该值可以是任何一个下面的字符串:
"unspecified"
- 默認值. 由系統選擇顯示方向. 在不同的設備可能會有所不同.
"landscape"
- 橫向
"portrait"
- 縱向
"user"
- 用戶當前的首選方向
"behind"
- 與在活動堆棧下的活動相同方向
"sensor"
- 根據物理方向傳感器確定方向. 取決於用戶手持的方向, 當用戶轉動設備, 它跟隨改變.
"nosensor"
- 不經物理方向傳感器確定方向. 該傳感器被忽略, 所以當用戶轉動設備, 顯示不會跟隨改變. 除了這個區別,系統選擇使用相同的政策取向對於“未指定”設置. 系統根據“未指定”("unspecified")設定選擇相同顯示方向.
如果要使Activity的View界面全屏,只需要将最上面的信号栏和Activity的Title栏隐藏掉即可,隐藏Title栏的代码:
requestWindowFeature(Window.FEATURE_NO_TITLE); 配置文件里代码: android:theme="@android:style/Theme.NoTitleBar" 隐藏信号栏的代码: getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 其它使用: getWindow().setFlags(WindowManager.LayoutParams.TYPE_STATUS_BAR, WindowManager.LayoutParams.TYPE_STATUS_BAR);
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属性限制
- linux find 命令忽略某个或多个子目录的方法
- traits简单认识
- CoreThink主题开发(八)使用H-ui开发博客主题之用户登录之前及登录之后
- hdu1010 扩展KMP求字符串最小循环节
- 获取和推送镜像
- android:screenOrientation属性
- Object-c------NSSet的简单介绍
- 如何查看手机里的.db数据库文件
- template详解
- el表达式及jstl标签库
- Qt静态库下载与安装说明
- windos系统下通过优盘安装Ubuntu14.04系统
- Android实现信息安全中凯撒密码技术
- 静态储存