views:

1549

answers:

3

I'm pretty close to finished with my first game for Android, and I've come across a problem that's so simple I'm sure I'll feel stupid for not knowing how to solve it, but how can I force the app to stay in a Horizontal layout? Right now, if you turn the phone (emulator) it flips the graphics and squeezes them. I want the game to start horizontally and stay that way regardless of how the user turns the phone.

Thank you.

+2  A: 

Hi, In the AndroidManifest file, try add android:screenOrientation="landscape" to the activity's attribute.

e.g.

<activity android:name=".myMainActivity"
          android:screenOrientation="landscape">

Or, you could use a R.styleable file and set the Orientation settings there. More info

keyboardP
A: 

I think you should be able to set

android:screenOrientation="landscape"

on your Activity in the manifest. It doesn't look like there's an Application wide setting, so you'll probably need to do it for each Activity separately.

Erich Douglass
+7  A: 

Hi there!

Open the AndroidManifest.xml and add the following android:screenOrientation="landscape" e.g.

 <activity android:name=".ActivtyName" 
       android:screenOrientation="landscape"
                >
Ally
Yes, this worked perfectly, thank you.
Ben Mc