Customize auto rotation and safe areas
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
GRVAppContainerLaunch.sharedInstance().openApp(withApppId: YOUR_APP_ID,
extraParams: ["screenOrientation":"landscape"])
Safe areas
For iPhone X and above, Griver ignores all safe areas by default. You can customize this behavior using the start-up parameter edgesIgnoringSafeArea
to ignore only a subset of the edges.
edgesIgnoringSafeArea
is an optional enum. For example, if you want your pages to respect the safe area on the left, use the code below:
GRVAppContainerLaunch.sharedInstance().openApp(withApppId: YOUR_APP_ID,
extraParams: ["edgesIgnoringSafeArea":UIRectEdge.bottom.rawValue | UIRectEdge.right.rawValue])
Note: Griver always respects UIRectEdgeTop
(the constant to specify the top edge) and you cannot ignore the safe area on this edge.