In the AndroidManifest manifest file, the screenOrientation attribute of Activity is explained in detail

screenOrientation is used to control the screen orientation of Acivity, and there are 16 parameters.

parameter value Function auto-rotate on auto-rotate off
unspecified -1 Let the system determine the direction of the Activity, which is determined by the sensor and system settings four directions no rotation
landscape 0 Force to landscape, ignore sensor and system settings no rotation no rotation
portrait 1 Force to portrait, ignore sensor and system settings no rotation no rotation
user 2 Use the user's current preferred orientation four directions no rotation
behind 3 The same direction as the Activity under the Activity stack four directions no rotation
sensor 4 Determine the direction according to the sensor, ignoring the system settings four directions four directions
nosensor 5 ignore system settings, ignore sensors no rotation no rotation
sensorLandscape 6 By default, the horizontal screen is used, ignoring the system settings, but it can respond to the operation of the sensor Two orientations of landscape Two orientations of landscape
sensorPortrait 7 By default, the vertical screen is used, ignoring the system settings, but it can respond to the operation of the sensor Vertical screen in both directions Vertical screen in both directions
reverseLandscape 8 Use landscape orientation by default, and flip 180 degrees from the default landscape orientation Can only use flipped landscape Can only use flipped landscape
reversePortrait 9 By default, the vertical screen is used, and the orientation of the default vertical screen is flipped 180 degrees Can only use flipped portrait orientation Can only use flipped portrait orientation
fullSensor 10 Determined by the sensor, it can be rotated in any direction (the sensor can only rotate the default horizontal and vertical screen) four directions four directions
userLandscape 11 The default is horizontal screen, but it can be rotated to any horizontal screen orientation according to the sensor Two orientations of landscape default landscape orientation
userPortrait 12 The default is vertical screen, but it can be rotated to any vertical screen orientation according to the sensor Both orientations of portrait default portrait orientation
fullUser 13 Any orientation of the user is allowed four directions no rotation
locked 14 lock to current orientation no rotation no rotation

Guess you like

Origin blog.csdn.net/qq_41264674/article/details/132344162