关于android屏幕旋转问题
2017-11-15 14:17
393 查看
转载自:http://blog.csdn.net/oracleot/article/details/19045011
通常我们的应用只会设计成横屏或者竖屏,锁定横屏或竖屏的方法是在manifest.xml文件中设定属性android:screenOrientation为”landscape”或”portrait”:
其实screenOrientation还可以设置成很多值:
android:screenOrientation = [“unspecified” | “behind” |
“landscape” | “portrait” |
“reverseLandscape” | “reversePortrait” |
“sensorLandscape” | “sensorPortrait” |
“userLandscape” | “userPortrait” |
“sensor” | “fullSensor” | “nosensor” |
“user” | “fullUser” | “locked”]
其中sensorLandscape就是横屏根据重力上下翻转,sensorPortrait竖屏根据重力上下翻转。
如果有兴趣,你也可以试试其他的值哦…
通常我们的应用只会设计成横屏或者竖屏,锁定横屏或竖屏的方法是在manifest.xml文件中设定属性android:screenOrientation为”landscape”或”portrait”:
<activity android:name="com.example.kata1.MainActivity" android:label="@string/app_name" android:screenOrientation="landscape"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
其实screenOrientation还可以设置成很多值:
android:screenOrientation = [“unspecified” | “behind” |
“landscape” | “portrait” |
“reverseLandscape” | “reversePortrait” |
“sensorLandscape” | “sensorPortrait” |
“userLandscape” | “userPortrait” |
“sensor” | “fullSensor” | “nosensor” |
“user” | “fullUser” | “locked”]
其中sensorLandscape就是横屏根据重力上下翻转,sensorPortrait竖屏根据重力上下翻转。
如果有兴趣,你也可以试试其他的值哦…
相关文章推荐
- AndroidPad的适配关于屏幕旋转方向问题详解
- 关于android旋转屏幕时activity重建和android 转屏 onConfigurationChanged 不会执行的问题
- 关于屏幕旋转的问题
- IOS成长之路-关于iOS6.0 屏幕旋转的问题
- 关于IOS屏幕的旋转问题
- Android 屏幕旋转问题
- 转载 -- IOS成长之路-关于iOS6.0 屏幕旋转的问题
- 关于Android设备下的屏幕适配问题
- 关于android中启动画面的旋转问题
- android屏幕旋转可能带来的问题
- android 开发屏幕旋转问题
- 【重头学习Android】关于UI切图和屏幕适配问题
- Android 关于屏幕的设置问题
- 关于android 的屏幕自适应问题
- android关于手机拍照图片旋转问题
- Android开发之--关于获取屏幕宽度和高度的问题
- 关于IOS屏幕的旋转问题
- 关于android屏幕适配的问题
- 关于iOS6.0 屏幕旋转的问题
- ios 关于禁止屏幕旋转问题的解决