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"

  • 相关阅读:
    《骆驼祥子》
    《基督山伯爵》
    JDeveloper 假死问题
    JSP代码执行顺序
    Ajax简单案例(实现提交值到服务器值不刷新页面)
    JS和JSP之间值传递
    如何更好的编码
    Telnet 便捷执行脚本
    MyBatis 缓存
    MyBatis 中传递多个参数的 4 种方式
  • 原文地址:https://www.cnblogs.com/zdzyc/p/2715270.html
Copyright © 2011-2022 走看看