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