How to Configure Android Screen Orientation in Monaca

Asked 2 years ago, Updated 2 years ago, 45 views

I am currently developing an Android app on Monaca. I don't know how to set the orientation of the screen.

I looked it up on the Internet and found out that
android:screenOrientation="landscape" can be added to activity in AndroidManifest.xml, but it cannot be controlled.
Does Android 4.4.4 not work?

Please let me know.

android monaca

2022-09-30 16:01

1 Answers

For Android,

located in config.xml
<preference name="Orientation" value="default"/>

Set the value to portrait for vertical and landscape for horizontal.

11/10 Additional
Select SettingsAndroid Application Settings from the Monaca Cloud IDE and scroll to the bottom to see the screen orientation.
If you select a direction and save it, the above items in config.xml will be rewritten.


2022-09-30 16:01

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.