屏幕方向android:screenOrientation

来源:互联网 发布:金蝶软件使用 编辑:程序博客网 时间:2024/05/10 02:20

http://developer.android.com/guide/topics/manifest/activity-element.html#screen

Android Manifest-->activity。

android:screenOrientation
The orientation of the activity's display on the device. activity在设备上显示的方向。

The value can be 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, may 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 be either normal or reverse landscape based on the devicesensor.Added in API level 9.

横屏,正反取决于传感器

"sensorPortrait"

Portrait orientation, but can be either normal or reverse portrait based on the devicesensor.Added in API level 9.

竖屏,正反取决于传感器

"sensor"

The orientation is determined by the device orientation sensor. The orientation of thedisplay depends on how the user is holding the device; it changes when the user rotates thedevice. Some devices, though, will not rotate to all four possible orientations, by default. Toallow all four orientations, use "fullSensor".

传感器决定

"fullSensor"

The orientation is determined by the device orientation sensor for any of the 4 orientations.This is similar to"sensor" except this allows any of the 4 possible screen orientations,regardless of what the device will normally do (for example, some devices won't normally use reverseportrait or reverse landscape, but this enables those).Added in API level 9.

传感器决定,四个方向都可以,与sensor类似

"nosensor"

The orientation is determined without reference to a physical orientation sensor. The sensoris ignored, so the display will not rotate based on how the user moves the device. Except for thisdistinction, the system chooses the orientation using the same policy as for the "unspecified" setting.

不使用传感器,方向由unspecified来决定

Note: When you declare one of the landscape or portrait values,it is considered a hard requirement for the orientation in which the activity runs. As such,the value you declare enables filtering by services such as Google Play so your application isavailable only to devices that support the orientation required by your activities. Forexample, if you declare either"landscape", "reverseLandscape", or"sensorLandscape", then your application will be available only to devices that supportlandscape orientation. However, you should also explicitly declare thatyour application requires either portrait or landscape orientation with the <uses-feature>element. For example, <uses-featureandroid:name="android.hardware.screen.portrait"/>. This is purely a filtering behaviorprovided by Google Play (and other services that support it) and the platform itself does notcontrol whether your app can be installed when a device supports only certain orientations.


原创粉丝点击