In the development of Android applications, you sometimes need to restrict horizontal and vertical screen switching. You only need to add the Android: screenorientation attribute restriction to the androidmanifest. xml file.
-
- Android: screenorientation="Landscape"Is to restrict the horizontal display of this page,
-
- Android: screenorientation="Portrait"Is to limit the number of faces on this page to be displayed on the vertical screen.
[HTML] View
Plaincopy
- Android: screenorientation = " Landscape " restrict the horizontal display of this page,
-
- Android: screenorientation="Portrait"Is to limit the number of faces on this page to be displayed on the vertical screen.
Android: screenorientation: sets the direction of the activity. The value can be any of the following strings:
"Unspecified"
-The default value is selected by the system to indicate the direction. Different settings may vary.
"Landscape"
-Forward Direction
"Portrait"
-Forward Direction
"User"
-Use the marker as the first choice.
"Behind"
-Same direction as the activity under the active action heap
"Sensor"
-The root node determines the direction of the sensor in the physical direction. It determines the direction in which the camera is used. When the camera is used, it changes with the camera.
"Nosensor"
-The direction is determined by the sensor without the physical direction. the sensor is ignored, so when we use the dynamic configurator, it indicates that it will not change with changes. except this region, the system selects the same policy orientation for "unspecified" settings. system root selection "unspecified" ("unspecified") sets the same direction for selection.
To make the View Interface of the activity full screen, you only need to hide the top signal bar and the title bar of the activity.Code:
Requestwindowfeature (window. feature_no_title );
-
-
- Code in the configuration file:
- Android: Theme = " @ Android: style/theme. notitlebar "
-
- Code for hiding the signal bar:
- Getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager. layoutparams. flag_fullscreen );
-
- Other usage:
-
- Getwindow (). setflags (windowmanager. layoutparams. type_status_bar, windowmanager. layoutparams. type_status_bar );