3

Is it possible to disable a UITabBarItem without greying out the image and text? I'm disabling an item but when the item becomes disabled it's image and text are also dimmed. Is there any way to keep the default selected appearance while also having it disabled?

This image is what the bar looks like when the item is disabled. disabled middle tab bar item

This image is what the bar looks like when the item is enabled. enabled middle tab bar item

Mbusi Hlatshwayo
  • 554
  • 1
  • 10
  • 23

2 Answers2

0

You can do tweak like customize your UITabBarController and get the tabbaritems and update the image

Hussain Shabbir
  • 14,801
  • 5
  • 40
  • 56
0

I assume that you are setting the UITabBarItem isEnabled property to false. Instead of doing that possibly you could disable clicking on some items with UITabBarControllerDelegate instead. You could implement one of the delegate methods to return false where needed.

func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
    return false
}
Leszek Szary
  • 9,763
  • 4
  • 55
  • 62