26
2017
09

ScreenOrientation

说明

ScreenOrientation意指屏幕方向。

官方文档

The orientation of the activity's display on the device. The value can be any one of the following strings。

Activity在设备上显示方向可为下列中任一值。

具体

  • 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.
    与堆栈中该Activity下层Activity方向相同。
    
  • 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.
    与正常横向显示方向相反。在API Level 9中被引入。
    
  • reversePortrait

    Portrait orientation in the opposite direction from normal portrait.Added in API level 9.
    与正常纵向方向显示相反。在API Level 9中被引入。
    
  • sensorLandscape

    Landscape orientation, but can be either normal or reverse landscape based on the device sensor. Added in API level 9.
    横向显示,但基于设备传感器,既可按正常方向显示,也可反向显示。在API Level 9中被引入。
    
  • sensorPortrait

    Portrait orientation, but can be either normal or reverse portrait based on the device sensor. Added in API level 9.
    纵向显示,但基于设备传感器,既可按正常方向显示,也可反向显示。在API Level 9中被引入。
    
  • sensor

    The orientation is determined by the device orientation sensor. The orientation of the display depends on how the user is holding the device; it changes when the user rotates the device. Some devices, though, will not rotate to all four possible orientations, by default. To allow all four orientations, use "fullSensor".
    显示方向由设备方向传感器决定。显示方向依赖于用户怎么持有设备;显示方向随用户旋转而变化。但默认情况下,一些设备不会在所有四个可能方向都旋转。若需在所有四个方向都旋转,需使用`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 reverse portrait or reverse landscape, but this enables those). Added in API level 9.
    显示方向(4个方向)由设备方向传感器决定。除允许屏幕有4个显示方向外,其它类似于`sensor`,不管什么样设备,通常都会这么做。(例如,一些设备通常不使用纵向倒转或横向倒转,但该设置仍会致使这样的反转)。在API Level 9中被引入。
    
  • nosensor

    The orientation is determined without reference to a physical orientation sensor. The sensor is ignored, so the display will not 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.
    屏幕显示方向不会参照物理方向传感器。传感器被忽略,故显示方向不会随用户设备位置变化而旋转。除该差别外,系统使用与`unspecified`相同策略来选择方向。
    
上一篇:EditText中输入密码时的显示和隐藏三种方法 下一篇:安卓——屏蔽陌生来电