How can I change the text and icon colors for UITabBar and UITabBarItems in iOS 7? The default gray text seems dim and hard to read for unselected tabbar items.
相关问题
- @objc protocol crashes the swift compiler
- Getting UITableViewCell from its superview iOS 7 i
- didSelectViewController method not being called (w
- Access paging in iOS - previous and next : retriev
- Install Ad Hoc distributed app on iOS via USB, usi
相关文章
- didBeginContact:(SKPhysicsContact *)contact not in
- ios7 new pan gesture to go back in navigation stac
- IOS UICollectionview Dynamically change Cell's
- PhoneGap iOS 7 and localStorage
- Add UITextField to title view of navigation item
- Is it possible to display a SFSafariViewController
- iOS7 crashing - [__NSPlaceholderDictionary initWit
- SKStoreProductViewController rate disabled on iOS
@Usharao answer above worked for me;
My problem was on startup all my TabBarItems seemed to be in a selected state, all having the same "Blue" tinted colour. By selecting all the tabs one by one the coloured state would become corrected.
I used this code below in my AppDelegate class: (compatible for >= IOS9)
use
self.tabBarController.tabBar.barStyle = UIBarStyleBlack;
to make the tab bar blackTested in iOS 8 for permanent text color (selected/unselected) and image colors (selected/unselected) without create two images with different colors foreach tab:
Text color:
Images color: (assuming that the original images have the color you want display as unselected)
In a UITabBarController subclass -awakeFromNib :
Credits: the whole internet and stack overflow XD
This worked for me, to tint not active items in the tabbar
// here you need to use the icon with the color you want, as it will be rendered as it is
// this icon is used for selected tab and it will get tinted as defined in
There are two things you need to do for this:
1) If you want to customize the TabBar itself, you need to set the barTintColor for the tabBarController:
2) Set the tabBarItem text appearance for each state that you want to override: