在开发android的应用中,有时候需要限制横竖屏切换。只需要在AndroidManifest.xml文件中加入android:screenOrientation属性限制。

  1. android:screenOrientation="landscape"是限制此页面横屏显示,
  2. android:screenOrientation="portrait"是限制此页面数竖屏显示。
[html] view plain copy
  1. android:screenOrientation="landscape"是限制此页面横屏显示,
  2. android:screenOrientation="portrait"是限制此页面数竖屏显示。
  3. //"unspecified" 由系统决定
  4. //"user"用户当前首选方向
  5. //"behind"与活动堆栈的活动相同
  6. //sensor"根据物理传感器方向而定
  7. //nosensor"不根据物理传感器

更多相关文章

  1. Android:EditText 所有属性
  2. android xml布局文件属性说明
  3. android xml属性大全
  4. Android(安卓)资源聚集地
  5. Android控件笔记——在界面中显示及输入文本信息
  6. android TextView 文本过长时用滚动条显示
  7. android TextView 文本过长时用滚动条显示
  8. Android:控件的隐藏显示失效了
  9. cc

随机推荐

  1. 再识android (一)
  2. 《Android程序设计》一3.9 把软件移植到A
  3. AIDL基础介绍
  4. 国内移动应用市场盘点(Android平台)
  5. Google公开指责微软、苹果和甲骨文试图通
  6. Android视频播放器屏幕左侧边随手指上下
  7. Android开发者如何才能提高应用排名
  8. Android(安卓)YUV视频数据叠加时间信息
  9. Android(安卓)- SharedPreferences 数据
  10. Android在高jar包版本的工程中修改方法