-2

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

我们在清单文件的所有活动定义中都有 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>
4

1 回答 1

-1

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

<activity android:name="MyApp" android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden"></activity>
于 2013-03-20T12:29:20.777 回答