Uitabbaritem Icon Not Colored Correctly for iOS 13 When a Bar Tint Color Is Specified in Interface Builder in Xcode 11, Beta 2

UITabBarItem icon not colored correctly for iOS 13 when a bar tint color is specified in Interface Builder in Xcode 11, beta 2

On the surface, this might seem like a bug, however you can mitigate it by defining an .unselectedItemTintColor on your UITabBar instance.

self.tabBar.unselectedItemTintColor = [UIColor lightGrayColor];

UITabBarController tint color problem on iOS 13

add your code in DispatchQueue and then try ...

  DispatchQueue.main.async {
// your code to change colour
tabBarController.tabBar.barTintColor = [UIColor blackColor]
}

ios13 - UITabBar tintColor for unSelectedItem not working

iOS 13 with Xcode 11

if #available(iOS 13, *) {
let appearance = UITabBarAppearance()
appearance.stackedLayoutAppearance.normal.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black]
appearance.stackedLayoutAppearance.selected.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.red]
appearance.stackedLayoutAppearance.normal.iconColor = UIColor.black
appearance.stackedLayoutAppearance.selected.iconColor = UIColor.red
myTabbar.standardAppearance = appearance
}

Set UITabBarItem image/icon in Interface Builder

Note: The full credit should go to null and akash. They contributed by answering half of the question each.

You can't have one of the icons from Apple that are avaible directly in Interface Builder and have a custom title. Instead, you must download the icon you want to use (Apple-looking icons are avaible at icons8), add it to the project resources and then pick it from the dropdown menu at Inspector -> Attributes inspector -> Bar Item -> Image.

How to make tabBar clear in iOS 13?

For transparent tabBar use - configureWithTransparentBackground()

For default tabBar use - configureWithDefaultBackground()

code:

if #available(iOS 13, *) {
let appearance = self.tabBarController?.tabBar.standardAppearance.copy()
appearance!.configureWithTransparentBackground()
tabBarController?.tabBar.standardAppearance = appearance!
} else {
tabBarController?.tabBar.shadowImage = UIImage()
tabBarController?.tabBar.backgroundImage = UIImage()
}


Related Topics



Leave a reply



Submit