android:screenOrientation属性
来源:互联网 发布:java 搜狐畅言 编辑:程序博客网 时间:2024/06/16 07:10
在开发android的应用中,有时候需要限制横竖屏切换。只需要在AndroidManifest.xml文件中加入android:screenOrientation属性限制。
<span style="font-size:14px;">android:screenOrientation="landscape"是限制此页面横屏显示,android:screenOrientation="portrait"是限制此页面数竖屏显示。</span>
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);
转自:http://blog.csdn.net/nmgchfzhzhg/article/details/8077133
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属性限制
- BZOJ 1485 HNOI 2009 有趣的数列 卡特兰数 线性筛法分解质因数
- 2013上半年—Linux操作系统—末考
- 隐藏标题栏
- Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be r
- CentOS/RHEL启动不起来-问题解决
- android:screenOrientation属性
- excel怎么转换成pdf格式的文件
- 2013上半年—嵌入式系统开发—实验
- proc
- 图像的几何矩
- Zend Guard Run-time support missing!
- 安装Zend Guard Loader
- 一个初学者的过滤器配置
- (11级计科2班-张文旭)关于LINUX连接网络问题