android:screenOrientation是用于指定应用程序的屏幕方向的属性。它可以在Manifest的activity元素中设置。可选值包括portrait、landscape、sensorPortrait、sensorLandscape、reversePortrait以及reverseLandscape。
例如,下面的代码片段将应用程序的屏幕方向设置为横屏:
注意,android:screenOrientation的设置将覆盖Activity中的任何代码设置的屏幕方向。如果您的Activity中包含了如下的Java代码:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
则在Manifest中设置android:screenOrientation的值将会被覆盖,屏幕将被锁定为竖屏方向。
参考文献: https://developer.android.com/guide/topics/manifest/activity-element#screen