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"

  • 相关阅读:
    通用Excel导入设计
    批量执行SQL文件
    ExtJS之对话框及窗口篇
    Windows Phone 7完整版模拟器
    C#迭代器
    XNA游戏开发之速度调整
    ExtJs之Panel篇
    Table锁定行列
    PB调用WebService示例(含源码)
    调用CodeSmith类库实现代码生成(含源码)
  • 原文地址:https://www.cnblogs.com/zdzyc/p/2715270.html
Copyright © 2011-2022 走看看