Search code examples
androidlayout

Android force Horizontal (landscape) layout


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.


Solution

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

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