mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 18:12:09 +08:00
chore: ios relayout condition cleanup (#10241)
This commit is contained in:
@ -138,19 +138,19 @@ allTests['STACKLAYOUT'] = stackLayoutTests;
|
||||
import * as flexBoxLayoutTests from './ui/layouts/flexbox-layout-tests';
|
||||
allTests['FLEXBOXLAYOUT'] = flexBoxLayoutTests;
|
||||
|
||||
// import * as safeAreaLayoutTests from './ui/layouts/safe-area-tests';
|
||||
// import * as safeAreaListViewtTests from './ui/list-view/list-view-safe-area-tests';
|
||||
// import * as scrollViewSafeAreaTests from './ui/scroll-view/scroll-view-safe-area-tests';
|
||||
// import * as repeaterSafeAreaTests from './ui/repeater/repeater-safe-area-tests';
|
||||
// import * as webViewSafeAreaTests from './ui/web-view/web-view-safe-area-tests';
|
||||
import * as safeAreaLayoutTests from './ui/layouts/safe-area-tests';
|
||||
import * as safeAreaListViewtTests from './ui/list-view/list-view-safe-area-tests';
|
||||
import * as scrollViewSafeAreaTests from './ui/scroll-view/scroll-view-safe-area-tests';
|
||||
import * as repeaterSafeAreaTests from './ui/repeater/repeater-safe-area-tests';
|
||||
import * as webViewSafeAreaTests from './ui/web-view/web-view-safe-area-tests';
|
||||
|
||||
// if (isIOS && Utils.ios.MajorVersion > 10) {
|
||||
// allTests['SAFEAREALAYOUT'] = safeAreaLayoutTests;
|
||||
// allTests['SAFEAREA-LISTVIEW'] = safeAreaListViewtTests;
|
||||
// allTests['SAFEAREA-SCROLL-VIEW'] = scrollViewSafeAreaTests;
|
||||
// allTests['SAFEAREA-REPEATER'] = repeaterSafeAreaTests;
|
||||
// allTests['SAFEAREA-WEBVIEW'] = webViewSafeAreaTests;
|
||||
// }
|
||||
if (isIOS && Utils.ios.MajorVersion > 10) {
|
||||
allTests['SAFEAREALAYOUT'] = safeAreaLayoutTests;
|
||||
allTests['SAFEAREA-LISTVIEW'] = safeAreaListViewtTests;
|
||||
allTests['SAFEAREA-SCROLL-VIEW'] = scrollViewSafeAreaTests;
|
||||
allTests['SAFEAREA-REPEATER'] = repeaterSafeAreaTests;
|
||||
allTests['SAFEAREA-WEBVIEW'] = webViewSafeAreaTests;
|
||||
}
|
||||
|
||||
import * as rootViewsCssClassesTests from './ui/styling/root-views-css-classes-tests';
|
||||
allTests['ROOT-VIEWS-CSS-CLASSES'] = rootViewsCssClassesTests;
|
||||
|
@ -92,14 +92,16 @@ class UILayoutViewController extends UIViewController {
|
||||
}
|
||||
layoutOwner(force = false) {
|
||||
const owner = this.owner?.deref();
|
||||
if (!force && !!owner.nativeViewProtected?.layer.needsLayout?.()) {
|
||||
if (!owner) {
|
||||
return;
|
||||
}
|
||||
if (!force && owner.isLayoutValid && !owner.nativeViewProtected?.layer.needsLayout?.()) {
|
||||
// we skip layout if the view is not yet laid out yet
|
||||
// this usually means that viewDidLayoutSubviews will be called again
|
||||
// so doing a layout pass now will layout with the wrong parameters
|
||||
return;
|
||||
}
|
||||
|
||||
if (owner) {
|
||||
if (majorVersion >= 11) {
|
||||
// Handle nested UILayoutViewController safe area application.
|
||||
// Currently, UILayoutViewController can be nested only in a TabView.
|
||||
@ -147,7 +149,6 @@ class UILayoutViewController extends UIViewController {
|
||||
|
||||
IOSHelper.layoutView(this, owner);
|
||||
}
|
||||
}
|
||||
|
||||
public viewWillAppear(animated: boolean): void {
|
||||
super.viewWillAppear(animated);
|
||||
|
@ -312,13 +312,16 @@ class UIViewControllerImpl extends UIViewController {
|
||||
|
||||
layoutOwner(force = false) {
|
||||
const owner = this._owner?.deref();
|
||||
if (!force && !!owner.nativeViewProtected?.layer.needsLayout?.()) {
|
||||
if (!owner) {
|
||||
return;
|
||||
}
|
||||
if (!force && owner.isLayoutValid && !owner.nativeViewProtected?.layer.needsLayout?.()) {
|
||||
// we skip layout if the view is not yet laid out yet
|
||||
// this usually means that viewDidLayoutSubviews will be called again
|
||||
// so doing a layout pass now will layout with the wrong parameters
|
||||
return;
|
||||
}
|
||||
if (owner) {
|
||||
|
||||
// layout(owner.actionBar)
|
||||
// layout(owner.content)
|
||||
|
||||
@ -369,7 +372,6 @@ class UIViewControllerImpl extends UIViewController {
|
||||
|
||||
IOSHelper.layoutView(this, owner);
|
||||
}
|
||||
}
|
||||
|
||||
// Mind implementation for other controllerss
|
||||
public traitCollectionDidChange(previousTraitCollection: UITraitCollection): void {
|
||||
|
Reference in New Issue
Block a user