質問

I'm using eclipse and I'm trying to figure out how to only allow a Portrait state be used during game play. I can't seem to find any options in eclipse to block the Landscape state.

I'd appreciate any assistance. I know it's probably a simple matter, but I can't seem to find it and I've not tried to do this before.

Thanks in advance.

役に立ちましたか?

解決

In your AndroidManifest file you can achieve this. You will add the android:screenOrientation tag in your application declaration. Something like this

<application
    android:icon="@drawable/logo"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" 
    android:screenOrientation="portrait" > //HERE
    <activity
        android:name="com.test.SomeActivity"
        android:label="@string/app_name" >

You can change that to landscape as well. This attribute can also be applied to individual activities instead of the whole application if you need that.

他のヒント

In the activity tags of your manifest file, add this:

android:screenOrientation="portrait"
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top