I'm currently creating a side-scroller style game for my final year project for my degree.
I'm just wondering how you make the menu designed for when the phone is in horizontal orientation display, even when the phone is held in it's vertical orientation?
i.e. I want the user to know that the game has to be played with the phone in it's horizontal orientation and want the menu's to only display in the horizontal orientation.
Many thanks in advance.
Setting the app upWhen on the main screen, under the orientation section, you will see a number of options like 'Auto-rotate OFF', 'Auto-rotate ON', 'Forced Portrait' and 'Forced Landscape'. As the names suggest, you can use these buttons as one-tap shortcuts to toggle the orientation of your device.
On an iPhone with a Home button, swipe up from the bottom of the screen to access it. On an iPhone without a Home button, swipe down from the top-right corner of the screen instead. Here, tap on the rotation lock icon (which looks like a lock with a circular arrow) to turn it on or off.
Add the following attribute to your activity in your AndroidManifest.xml:
android:screenOrientation="landscape"
Well, I didn't get your question right, but if you are defining your menu via xml
create a new folder in your res folder named
for layout changes:
layout_land
for horizontal specific menu:
xml-land
for horizontal specific drawables:
drawable-land
and define your menu,layout and drawable changes there.
Further you can tell android framework that you want to handle rotation changes: by adding to your manifest(AndroidManifest.xml) activity child
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="landscape"
Comment exactly what you want.
Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With