Android:screenorientation Properties--Limit the screen to toggle

Source: Internet
Author: User

Ext.: http://blog.csdn.net/nmgchfzhzhg/article/details/8077133

In the development of Android applications, it is sometimes necessary to limit the screen shift. You only need to include the Android:screenorientation attribute limit in the Androidmanifest.xml file.
android:screenorientation= "Landscape" is to limit the horizontal display of this page,    android:screenorientation= "Portrait" is to limit the number of pages on the vertical screen.  

  

[HTML]View Plaincopy
android:screenorientation= "Landscape" is to limit the horizontal display of this page,    android:screenorientation= "Portrait" is to limit the number of pages on the vertical screen.

  


Android:screenorientation sets the direction of the activity, which can be any one of the following strings:

"Unspecified"
-Implied value. The system chooses the direction of the display. In different settings may vary.

"Landscape"
-Horizontal direction

"Portrait"
-To

"User"
-User's first choice direction

"Behind"
-In the same direction as the activity in the live heap

"Sensor"
-the direction of the sensor is determined by the physical direction of the transmitter. Depending on the direction the user is holding, when the user spins the equipment, it changes.

"Nosensor"
-Do not physically direction the transmitter to set the direction. The transmitter is ignored, so when the user spins the device, it does not change. In addition to this area, the system chooses to use the same policy orientation for "unspecified" setup. The system chooses the same display direction according to "unspecified" ("unspecified").

If you want the activity's view interface to be full-screen, simply hide the top signal bar and the activity's title bar and hide the code from the title bar:

Requestwindowfeature (Window.feature_no_title);
The code     in the config file:  android:theme= "@android: Style/theme.notitlebar"     hides the code of the signal bar:  GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);    Other uses:  GetWindow (). SetFlags (WindowManager.LayoutParams.TYPE_STATUS_BAR, WindowManager.LayoutParams.TYPE_ Status_bar);  

Android:screenorientation Property--limit screen to toggle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.