Android设置屏幕方向

设置方法:在AndroidManifest.xml中的Activity里加一个属性android:screenOrientation。例如设置该Activity为横向

<activity android:name=".Login"
android:screenOrientation="landscape">
</activity>

screenOrientation的值有以下几种:
landscape:横向
portrait:纵向
unspecified:默认值,由系统判断状态自动切换
user:用户当前设置的orientation值.
behind:下一个要显示的Activity的orientation值.
sensor:传感器的方向
nosensor:不使用传感器,这个效果差不多等于unspecified

原文地址:https://www.cnblogs.com/zhengjunfei/p/4632474.html