fix(ios-tabs): crash when add tabstrip in loaded event (#7743)

This commit is contained in:
Martin Yankov
2019-08-29 09:34:57 +03:00
committed by GitHub
parent ff6d89fc13
commit a66f2f2f47

View File

@ -82,7 +82,6 @@ class UIPageViewControllerImpl extends UIPageViewController {
public viewDidLoad(): void {
const owner = this._owner.get();
if (owner.tabStrip) {
const tabBarItems = owner.tabBarItems;
const tabBar = MDCTabBar.alloc().initWithFrame(this.view.bounds);
@ -102,7 +101,6 @@ class UIPageViewControllerImpl extends UIPageViewController {
this.tabBar = tabBar;
this.view.addSubview(tabBar);
}
}
public viewWillAppear(animated: boolean): void {
super.viewWillAppear(animated);
@ -159,6 +157,8 @@ class UIPageViewControllerImpl extends UIPageViewController {
}
this.tabBar.frame = CGRectMake(0, tabBarTop, this.tabBar.frame.size.width, tabBarHeight);
} else {
this.tabBar.hidden = true;
}
const subViews: NSArray<UIView> = this.view.subviews;