设置屏幕显示模式ScreenOrientation.

在activity里设置android:screenOrientation的值。
android:screenOrientation的属性有以下值:
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.
landscape,横屏
portrait,竖屏
user(用户当前设置的orientation值),The user's current preferred orientation.
behind(下一个要显示的Activity的orientation值),The same orientation as the activity that's immediately beneath it in the activity stack.
sensor(传感器的方向),The orientation determined by a physical orientation sensor. The orientation of the display depends on how the user is holding the device; it changes when the user rotates the device.
nosensor(不使用传感器,这个效果差不多等于unspecified).An orientation 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.

更多相关文章

  1. Android开发之Activity(二)——启动模式和taskAffinity属性
  2. android:clipChildren属性的分析——是否剪裁子View
  3. ImageView的属性
  4. 【Android】Android自定义属性,attr format取值类型
  5. Android使用TextView,设置onClick属性无效解决办法
  6. 【Android开发小记--6】动画--属性动画以及Fragment切换动画(3D)
  7. Activity属性

随机推荐

  1. Android PhoneStateListener 问题
  2. Android开源项目第一篇——个性化控件(Vi
  3. Android获取本机局域网IP的方法
  4. Android中DIP与PX的转换
  5. Android Gesture 手势识别
  6. Android P 版本中支持全面屏检测的api
  7. Android 多线程2
  8. Android Native Crash的log分析和定位
  9. android 关于InputDispatcher出现Consume
  10. Android(安卓)8.0 Navigationbar