Android:screenorientation's description

Source: Internet
Author: User

In the official Android documentation, the android:screenorientation is described below:

Http://www.cnblogs.com/snowberg/archive/2012/07/15/2618908.html

android:screenOrientationThe orientation of the activity ' s display on the device.

The value can is any one of the following strings:

"unspecified" The default value. The system chooses the orientation. The policy it uses, and therefore the choices made in specific contexts, could differ from device to device.
"user" The user ' s current preferred orientation.
"behind" The same orientation as the activity that's immediately beneath it in the activity stack.
"landscape" Landscape Orientation (the display is wider than it is tall).
"portrait" Portrait Orientation (the display is taller than it is wide).
"reverseLandscape" Landscape orientation in the opposite direction from normal Landscape. Added in API level 9.
"reversePortrait" Portrait orientation in the opposite direction from normal Portrait. Added in API level 9.
"sensorLandscape" Landscape orientation, but can is either normal or reverse Landscape based on the device sensor. Added in API level 9.
"sensorPortrait" Portrait orientation, but can is either normal or reverse Portrait based on the device sensor. Added in API level 9.
"sensor" The orientation is determined by the device orientation sensor. The orientation of the display depends on what the user is holding the device; It changes when the user rotates the device. Some devices, though, won't rotate to all four possible orientations, by default. To allow any four orientations "fullSensor" .
"fullSensor" The orientation is determined by the device orientation sensor for any of the 4 orientations. This "sensor" was similar to except this allows any of the 4 possible screens orientations, regardless of what the device would Normally do (for example, some devices won ' t normally use reverse portrait or reverse landscape, but this enables those). Added in API level 9.
"nosensor" The orientation is determined without reference to a physical orientation sensor. The sensor is ignored, so the display would not be rotate based on how the user moves the device. Except for this distinction, the system chooses the orientation using the same policy as for the " unspecified " setting.

Note:When you declare one of the landscape or portrait values, it's considered a hard requirement for the orientation in which The activity runs. As such, the value of declare enables filtering by services such as Google Play so your application are available only to Devices the orientation required by your activities. For example, if declare either"landscape","reverseLandscape", or"sensorLandscape", then your application'll be available-only to devices, the support landscape orientation. However, you should also explicitly declare the your application requires either portrait or landscape orientation with t He<uses-feature>Element. For example,<uses-feature android:name="android.hardware.screen.portrait"/>. This was purely a filtering behavior provided by Google Play (and other services, it) and the platform itself D OES not control whether your apps can be installed when a device is supports only certain orientations.

The translation is:

Android:screenorientation

The direction the activity displays in the screen. The property value can be one of the values listed in the following table:

"unspecified" Default value, the system selects the direction. Its use policy, and because of the specific context of the selection, may vary depending on the device.
"user" Use the user's current preferred orientation.
"behind" Use the same direction in the activity stack as the activity under that activity.
"landscape" Horizontal display (width is larger than height)
"portrait" Portrait display (height is larger than width)
"reverseLandscape" In contrast to the normal horizontal direction, it is introduced in API level 9.
"reversePortrait" In contrast to the normal longitudinal direction, it is introduced in API level 9.
"sensorLandscape" Horizontal display, but based on the device sensor, can be displayed in normal direction, or reverse display, in the API Level 9 is introduced.
"sensorPortrait" Vertical display, but based on the device sensor, can either be displayed in normal direction, or reverse display, in the API Level 9 is introduced.
"sensor" The direction of the display is determined by the direction sensor of the device. The display direction depends on how the user holds the device, and the direction of the display changes when the user rotates the device. However, by default, some devices do not rotate in all four directions, so to allow rotation in all four directions, use the Fullsensor property value.
"fullSensor" The direction of the display (4 directions) is determined by the direction sensor of the device, except that it allows the screen to have 4 display orientations, and the other is similar to when set to "sensor", which is usually done regardless of the device. For example, some devices typically do not use portrait or landscape inversion, but this setting will still cause such reversals. This value is introduced in API level 9.
"nosensor" The display direction of the screen does not refer to the physical direction sensor. The sensor is ignored, so the display does not rotate because the user is moving the device. In addition to this difference, the system rotates the orientation of the screen with the same policy as the "unspecified" setting.

Note: When the value set for this property is "landscape" or portrait, consider the direction that the hardware will require for the activity to run. Because of this, the values of these claims can be filtered by services such as Google Play so that applications can only be applied to devices that support the direction required by the activity. For example, if you declare "Landscape", "reverselandscape", or "Sensorlandscape", the application can only be applied to devices that support landscape display. However, you should also use the <uses-feature> element to explicitly declare whether all the screen orientations of the application are vertical or horizontal. For example: <uses-feature android:name= "android.hardware.screen.portrait"/>. This setting is purely filtered by Google Play, and the platform itself does not control whether the application can be followed when the device supports only a particular orientation.

Android:screenorientation's description

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.