UIToolbar tintColor
@property(nonatomic, retain) UIColor *tintColor
Discussion of [UIToolbar tintColor]
The default value is nil.
UIToolbar tintColor example.
UIToolbar also has a tintColor property, just like a UINavigationBar. You should be able to set one to the other:
myToolbar.tintColor = myNavBar.tintColor;
after you create your toolbar. Keep in mind that this code would only work if myNavBar had been loaded from the NIB, so it would be best to put this in viewWillAppear: or viewDidLoad.
myToolbar.tintColor = myNavBar.tintColor;
after you create your toolbar. Keep in mind that this code would only work if myNavBar had been loaded from the NIB, so it would be best to put this in viewWillAppear: or viewDidLoad.
Example of [UIToolbar tintColor].
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];
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 tintColor example.
// Toolbar content
NSArray *items=[NSArray arrayWithObjects: ... ]; // PSEUDO CODE HERE
[toolbar setItems:items];
// Add tint
toolbar.tintColor = [UIColor colorWithRed:0.83 green:0.43 blue:0.57 alpha:0.5];
What I needed to do, was just reverse the order of things:
// Add tint
toolbar.tintColor = [UIColor colorWithRed:0.83 green:0.43 blue:0.57 alpha:0.5];
// Toolbar content
NSArray *items=[NSArray arrayWithObjects: ... ]; // PSEUDO CODE HERE
[toolbar setItems:items];
NSArray *items=[NSArray arrayWithObjects: ... ]; // PSEUDO CODE HERE
[toolbar setItems:items];
// Add tint
toolbar.tintColor = [UIColor colorWithRed:0.83 green:0.43 blue:0.57 alpha:0.5];
What I needed to do, was just reverse the order of things:
// Add tint
toolbar.tintColor = [UIColor colorWithRed:0.83 green:0.43 blue:0.57 alpha:0.5];
// Toolbar content
NSArray *items=[NSArray arrayWithObjects: ... ]; // PSEUDO CODE HERE
[toolbar setItems:items];