mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat: add iosExpandSafeArea property
Also apply insets on page's children.
This commit is contained in:
committed by
Martin Yankov
parent
fa526e0e7b
commit
1c94c38491
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user