feat: add iosExpandSafeArea property

Also apply insets on page's children.
This commit is contained in:
Vasil Chimev
2018-08-22 14:37:51 +03:00
committed by Martin Yankov
parent fa526e0e7b
commit 1c94c38491
4 changed files with 22 additions and 6 deletions

View File

@@ -120,7 +120,7 @@ class UIViewControllerImpl extends UIViewController {
// Skip navigation events if modal page is shown.
if (!owner._presentedViewController && frame) {
const newEntry = this[ENTRY];
let isBack: boolean;
// We are on the current page which happens when navigation is canceled so isBack should be false.
if (frame.currentPage === owner && frame._navigationQueue.length === 0) {
@@ -309,7 +309,13 @@ export class Page extends PageBase {
public onLayout(left: number, top: number, right: number, bottom: number) {
const { width: actionBarWidth, height: actionBarHeight } = this.actionBar._getActualSize;
View.layoutChild(this, this.actionBar, 0, 0, actionBarWidth, actionBarHeight);
View.layoutChild(this, this.layoutView, left, top, right, bottom);
const insets = this.getSafeAreaInsets();
const childLeft = left + insets.left;
const childTop = top + insets.top;
const childRight = right - insets.right;
const childBottom = bottom - insets.bottom;
View.layoutChild(this, this.layoutView, childLeft, childTop, childRight, childBottom);
}
public _addViewToNativeVisualTree(child: View, atIndex: number): boolean {
@@ -327,7 +333,7 @@ export class Page extends PageBase {
if (this.viewController.presentedViewController === viewController) {
return true;
}
this.viewController.addChildViewController(viewController);
}