How to change UITabBar Selection color


How to change UITabBar Selection color



I need to change the selection color of UITabBar from default blue to red. How do we do this.


Getting first three digits from int/float

1:

How can a C# programmer build software for iPhone?
You must did this by setting a "tintColor" attrialthough e (Key Path) for you UITabBar.. Saving reference to UITableViewCell
  1. Select the UITabBar in the document outline. Reformatting for landscape view(NOT the Controller with the yellow icon.)
  2. Select Identity Inspector in the Utilities area.
  3. Click the + in "User Defined Runtime Attrialthough es."
  4. Add a "tintColor" Key Path of type "Color" and the color you want.
This should did it. Fade in/out UIScrollView's content like Mobile Safari does in its tabYou must check it against the screenshot below.. warning: declaration does not declare anything enter image description here. How to Base64 encoding on the iPhone More on this: There's a "Tint" attrialthough e in Identity Inspector of UITabBar which I believed would did the exact same thing although apparently, it does nothing. UIWebView slow loading images--disturbs scrolling to anchorsIt's default value is the exact default fill color when a UITabBarItem is selected, so my guess is it would be fixed in the stable release Xcode 7. Fingers crossed..

2:

In IOS5, UITabBar has a selectedImageTintColor property which does what you need..

3:

In iOS 7 it's simply the tintColor. One way to accomplish this could be to subclass UITabBarViewController, set the custom class in the storyboard, and in your viewDidLoad method of the subclassed tabBarVC add this:.
[[self tabBar] setTintColor:[UIColor redColor]]; 

4:

It is extremely easy. Create a custom class of UITabBarController and in -(void)viewDidLoad method add this line:.
[[self tabBar] setSelectedImageTintColor:[UIColor greenColor]];  

5:

The SDK does not make this easy, although it is technically possible. Apple apparently believes this to be part of their vision of a consistent look and feel.. UITabBar is a subclass of UIView. You must always subclass and implement your own -drawRect:. This is not a trivial task, however, you have to essentially re-implement the class from scratch or you risk any weird side-effects. .

6:

Because UITextAttrialthough eTextColor is deprecated in iOS 7, you should use: .
[UITabBarItem.appearance setTitleTextAttrialthough es:@{NSForegroundColorAttrialthough eName : [UIColor greenColor]} forState:UIControlStateNormal];     [UITabBarItem.appearance setTitleTextAttrialthough es:@{NSForegroundColorAttrialthough eName : [UIColor purpleColor]} forState:UIControlStateSelected]; 

7:

I've been searching for a way to set the selected text color of a UITabBarItem and have found a dead simple method, using the UIAppearance protocol..
[UITabBarItem.appearance setTitleTextAttrialthough es:@{         UITextAttrialthough eTextColor : [UIColor greenColor] } forState:UIControlStateNormal];  [UITabBarItem.appearance setTitleTextAttrialthough es:@{         UITextAttrialthough eTextColor : [UIColor purpleColor] }     forState:UIControlStateSelected]; 
Please excuse the awful colors!.

8:

iOS 5.0 fixes this issue although the quick fix is under NDA. Look up UITabBar in your documentation for an EASY way to did what you want to do..

9:

Starting from iOS 8 it's as simple as:.
UITabBar.appearance().tintColor = UIColor.redColor() 


72 out of 100 based on 42 user ratings 32 reviews