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
How to Get MAC Address from Cbperipheral and Cbcenter
Objective C- Trouble Updating UI on Main Thread
How to Upload Multiple Image on Firebase Using Swift
Sprite Kit Set Min. and Max. for Jump
Fbsdkaccesstoken Currentaccesstoken Is Not Being Updated After Log In
How to Differentiate Whether a User Is Tapping the Screen with His Finger or an Apple Pencil
Show Data in Uipickerview Second Component Based on First Component Selection
Programmatically Determine Current Target (Run or Test) in iOS Project
Xcode:How to Set App to Be iPhone Only
Avassetresourceloaderdelegate Methods Not Working on Device
iOS App Getting Throttled from Local Searches
Swift 3- How to Get Button in Uicollectionviewcell Work
Searching Through Child Values Firebase/Swift
Executefetchrequest Throw Fatal Error: Nsarray Element Failed to Match the Swift Array Element Type
How to Get an Error Description When Playback Fails on Mpmovieplayercontroller
Storing [Nsnull Null] Values in Nsuserdefaults, from JSON Serialization, Causes Unwanted Exceptions