应用程序将纵向方向更改为motorola xoom上的横向

时间:2013-03-20 12:19:08

标签: android orientation landscape portrait xoom

我们正在开发一款应用程序,在第二次发布时,将硬编码的方向肖像更改为横向。

我们在清单文件中的所有活动定义中都有screenOrientation =“portrait”。

知道如何解决这个问题吗? 这是我的代码:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.myproject"
    android:installLocation="auto"
    android:versionCode="13"
    android:versionName="12.0" >

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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:icon="@string/icon"
        android:label="@string/app"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
        <meta-data
            android:name="com.mobclix.APPLICATION_ID"
            android:value="XXXX" />

        <activity
            android:name=".SplashActivity"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MainActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:screenOrientation="portrait" />
        <activity
            android:name=".xyactivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:screenOrientation="portrait" />
        <activity
            android:name=".xyzActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".abactivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name="com.mobclix.android.sdk.MobclixBrowserActivity"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    </application>

</manifest>

1 个答案:

答案 0 :(得分:-1)

为了限制纵向方向,您需要在清单文件中的声明期间为每个活动放置此代码

<activity android:name="MyApp" android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden"></activity>