mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
fix(ios-tabs): crash when add tabstrip in loaded event (#7743)
This commit is contained in:
@ -82,7 +82,6 @@ class UIPageViewControllerImpl extends UIPageViewController {
|
|||||||
public viewDidLoad(): void {
|
public viewDidLoad(): void {
|
||||||
const owner = this._owner.get();
|
const owner = this._owner.get();
|
||||||
|
|
||||||
if (owner.tabStrip) {
|
|
||||||
const tabBarItems = owner.tabBarItems;
|
const tabBarItems = owner.tabBarItems;
|
||||||
const tabBar = MDCTabBar.alloc().initWithFrame(this.view.bounds);
|
const tabBar = MDCTabBar.alloc().initWithFrame(this.view.bounds);
|
||||||
|
|
||||||
@ -102,7 +101,6 @@ class UIPageViewControllerImpl extends UIPageViewController {
|
|||||||
this.tabBar = tabBar;
|
this.tabBar = tabBar;
|
||||||
this.view.addSubview(tabBar);
|
this.view.addSubview(tabBar);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public viewWillAppear(animated: boolean): void {
|
public viewWillAppear(animated: boolean): void {
|
||||||
super.viewWillAppear(animated);
|
super.viewWillAppear(animated);
|
||||||
@ -159,6 +157,8 @@ class UIPageViewControllerImpl extends UIPageViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.tabBar.frame = CGRectMake(0, tabBarTop, this.tabBar.frame.size.width, tabBarHeight);
|
this.tabBar.frame = CGRectMake(0, tabBarTop, this.tabBar.frame.size.width, tabBarHeight);
|
||||||
|
} else {
|
||||||
|
this.tabBar.hidden = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const subViews: NSArray<UIView> = this.view.subviews;
|
const subViews: NSArray<UIView> = this.view.subviews;
|
||||||
|
Reference in New Issue
Block a user