Tuesday, June 11, 2013

UIToolbar setTintColor example in Objective C (iOS).

UIToolbar setTintColor

The color used to tint the bar.

@property(nonatomic, retain) UIColor *tintColor

Discussion of [UIToolbar setTintColor]
The default value is nil.

UIToolbar setTintColor example.
-(void)viewDidLoad{
    [super viewDidLoad];
    //Custom initialization
    [self.webControlsToolbar_ setTintColor:[UIColor colorWithRed:246.0/255.0 green:246.0/255.0 blue:246.0/255.0 alpha:1]];

}

Example of [UIToolbar setTintColor].
There no way to compare the colors of navigation bar and tool bar but you can set toolbar color with following code

    aToolbar.barStyle = UIBarStyleBlackTranslucent;
    aToolbar.tintColor = [UIColor blackColor];
    aToolbar.alpha = 0.7;
or

aToolBar.tintColor = [UIColor colorWithRed:0.15 green:0.35 blue:0.45 alpha:0.6];

UIToolbar setTintColor example.
Have a look at the setTintColor: method. For example:

[self.navigationController.toolbar setTintColor:[UIColor greenColor]];

End of UIToolbar setTintColor example article.