在AndroidManifest.xml里面的代码:

AndroidManifest.xml 里面加入这一行 android :screenOrientation="landscape "landscape 是横向,portrait 是纵向)。

<?xml version="1.0" encoding="utf-8"?>  <manifest xmlns:android="http://schemas.android.com/apk/res/android"      package="com.himi" android:versionCode="1" android:versionName="1.0">      <application android:icon="@drawable/icon" android:label="@string/app_name">          <activity android:name=".MainActivity" android:label="@string/app_name"              android:screenOrientation="landscape" >              <intent-filter>                  <action android:name="android.intent.action.MAIN" />                  <category android:name="android.intent.category.LAUNCHER" />              </intent-filter>          </activity>      </application>      <uses-sdk android:minSdkVersion="4" />  </manifest> 

  


更多相关文章

  1. Android硬件访问服务-Service
  2. Android开发之ConstraintLayout布局
  3. Android(安卓)View添加 Listener 小技巧示例
  4. Android(安卓)各种布局技术-五大布局对象
  5. 面试题5:椭圆里面有个内切圆,内切圆中有文字
  6. Android在应用中固定屏幕方向
  7. android 资源获取
  8. 2014.01.16(2) ——— android 关于适配的工具类
  9. Android(安卓)Tab切换表格头

随机推荐

  1. 41款实用工具,数据获取、清洗、建模、可视
  2. 数字化采样仪的革新与发展:SP Devices推出
  3. springcloud 配置集成 Sentinel 限流器
  4. Curtis-Wright公司推出面向高速嵌入式雷
  5. 手把手教你用OpenCV实现机器学习最简单的
  6. 深度系统更新(deepin 20 1003)
  7. 深度社区新版论坛正式上线!
  8. 深度系统更新(2020.11.11)
  9. 深度系统更新(2020.11.13)
  10. deepin20.1发布—细微之处 体验不凡