我正在创建一个Android游戏,其中每个活动都设置为xml清单文件中的横向。
然而,有时候在进行新活动时,它会以纵向闪烁一秒钟,然后再进行横向修正。
有没有人为什么会这样做呢?
使用ScheduledFuture
过早退出关卡完成屏幕时会发生这种情况由于 安迪
EDIT(Manifest):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.appsolutely.sheepherder"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.appsolutely.sheepherder.Main"
android:label="@string/app_name"
android:screenOrientation="landscape" >
</activity>
<activity
android:name="com.appsolutely.sheepherder.Game"
android:label="@string/title_activity_game"
android:screenOrientation="landscape" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.appsolutely.sheepherder.LevelSelect" />
</activity>
<activity
android:name="com.appsolutely.sheepherder.LevelSelect"
android:label="@string/title_activity_level_select"
android:screenOrientation="landscape" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.appsolutely.sheepherder.Main" />
</activity>
<activity
android:name="com.appsolutely.sheepherder.Splash"
android:label="@string/app_name"
android:screenOrientation="landscape" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.appsolutely.sheepherder.Plague"
android:label="@string/title_activity_plague"
android:screenOrientation="landscape" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.appsolutely.sheepherder.Main" />
</activity>
</application>
答案 0 :(得分:0)
尝试将screenOrientation
添加到您的清单中:
<activity android:screenOrientation="sensorLandscape" ...>
我建议使用sensorLandscape
,以便用户可以选择是否将设备向右或向左旋转。