zoukankan      html  css  js  c++  java
  • android内设置横屏

    要在android内设置横屏,只需要 在manifest.xml配置的activity写一句

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.zdz.cachefruit"
        android:versionCode="1"
        android:versionName="1.0" >

        <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="15" />

        <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme"
            >
          
            <activity
                android:name=".MainActivity"
                android:label="@string/title_activity_main"
                android:screenOrientation="landscape"
                android:configChanges="orientation">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>

    </manifest>

    但是一定要注意,此时oncreate会被调用两次,第二次是因为要转方向,要避免,可以加上一句

    android:configChanges="orientation"

  • 相关阅读:
    VUE DEVTOOLS 安装方法(npm cnpm 安装失败找不到安装工具问题解决方法)
    idea 注释模版
    阿里巴巴编码规范
    JRebel 实现热部署
    SPRING 扩展组件
    oracle 闪回
    ORACLE 日常
    springboot log4j
    支付宝异步回调验证签名的那些走过的坑
    ASP.NET MVC5(一)—— URL路由
  • 原文地址:https://www.cnblogs.com/zdzyc/p/2715270.html
Copyright © 2011-2022 走看看