layout: Native UI Layout

The forge.layout namespace allows you to access properties related to your app's native UI layout.

API

forge.layout.getSafeAreaInsets(success, error)

iOS, Android

The safe area of a view reflects the area not covered by navigation bars, tab bars, toolbars, and other UI elements that obscure the WebView.

Parameters:
success
function(safeAreaInsets) safeAreaInsets is a dictionary with the keys: top, left, bottom and right.
error
function(content) called with details of any error which may occur

forge.layout.setContentInsetAdjustmentBehavior(behavior, success, error)

iOS, Android

The content inset adjustment behavior controls the layout of your app content on devices with non-uniform displays.

Parameters:
behavior
string One of: always, short_edges (Android only) or never.
success
function() callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

Where the layout behavior for each of the modes are:

always

always: Your app will be automatically adjusted to always lie within the "safe" area of the device and will never extend into any of the cutout areas.

short_edges

short_edges: Content renders into the cutout area while in portrait mode, but content is letterboxed while in landscape mode. It is your responsibility to ensure that your app does not render content over any of the cutout areas. (Android only)

never

never: Your app content will extend into the cutout area on the short edge of the display in both portrait and landscape, regardless of whether the system bars or hidden or visible. It is your responsibility to ensure that your app does not render content over any of the cutout areas.