Customize auto rotation
Auto rotation
By default, Griver supports all orientations and auto rotates when your device's orientation changes.
You can customize this behavior using the start-up parameter screenOrientation
.
screenOrientation
The supported values for screenOrientation
are listed below:
Supported values | Description |
landscape | Constraints your pages to landscape (horizontal) orientation. |
portrait | Constraints your pages to portrait (vertical) orientation. |
auto | The default behavior. Your pages automatically rotate as your device's orientation changes. |
Sample code
copy
Bundle bundle = new Bundle();
bundle.putString("screenOrientation", "landscape");
// open Mini Program
Griver.openApp(this, appId, bundle);
// open web app
Griver.openUrl(this, url, bundle);