From c0c79f31cf94d05f2134da49d41a7e57126687a3 Mon Sep 17 00:00:00 2001 From: Manol Donev Date: Thu, 11 Jul 2019 00:35:38 +0300 Subject: [PATCH] fix(ios-tabs): item appearance toggle b/n titles and images (#7502) --- tns-core-modules/ui/tabs/tabs.ios.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tns-core-modules/ui/tabs/tabs.ios.ts b/tns-core-modules/ui/tabs/tabs.ios.ts index cd85641f0..979d93e41 100644 --- a/tns-core-modules/ui/tabs/tabs.ios.ts +++ b/tns-core-modules/ui/tabs/tabs.ios.ts @@ -84,10 +84,6 @@ class UIPageViewControllerImpl extends UIPageViewController { } 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.barTintColor = UIColor.whiteColor; tabBar.setTitleColorForState(UIColor.blackColor, MDCTabBarItemState.Normal); @@ -854,6 +850,8 @@ export class Tabs extends TabsBase { if (this.viewController && this.viewController.tabBar) { this.viewController.tabBar.itemAppearance = this._getTabBarItemAppearance(); 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); }