mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
fix(ios-tabs): item appearance toggle b/n titles and images (#7502)
This commit is contained in:
@ -84,10 +84,6 @@ class UIPageViewControllerImpl extends UIPageViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tabBar.delegate = this.tabBarDelegate = MDCTabBarDelegateImpl.initWithOwner(new WeakRef(owner));
|
tabBar.delegate = this.tabBarDelegate = MDCTabBarDelegateImpl.initWithOwner(new WeakRef(owner));
|
||||||
// Initially set `itemAppearance` to TitledImages.
|
|
||||||
// Reassign if needed when items available.
|
|
||||||
// Other combinations do not work.
|
|
||||||
tabBar.itemAppearance = MDCTabBarItemAppearance.TitledImages;
|
|
||||||
tabBar.tintColor = UIColor.blueColor;
|
tabBar.tintColor = UIColor.blueColor;
|
||||||
tabBar.barTintColor = UIColor.whiteColor;
|
tabBar.barTintColor = UIColor.whiteColor;
|
||||||
tabBar.setTitleColorForState(UIColor.blackColor, MDCTabBarItemState.Normal);
|
tabBar.setTitleColorForState(UIColor.blackColor, MDCTabBarItemState.Normal);
|
||||||
@ -854,6 +850,8 @@ export class Tabs extends TabsBase {
|
|||||||
if (this.viewController && this.viewController.tabBar) {
|
if (this.viewController && this.viewController.tabBar) {
|
||||||
this.viewController.tabBar.itemAppearance = this._getTabBarItemAppearance();
|
this.viewController.tabBar.itemAppearance = this._getTabBarItemAppearance();
|
||||||
this.viewController.tabBar.items = NSArray.arrayWithArray(tabBarItems);
|
this.viewController.tabBar.items = NSArray.arrayWithArray(tabBarItems);
|
||||||
|
// TODO: investigate why this call is necessary to actually toggle item appearance
|
||||||
|
this.viewController.tabBar.sizeToFit();
|
||||||
this.tabStrip.setNativeView(this.viewController.tabBar);
|
this.tabStrip.setNativeView(this.viewController.tabBar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user