Showing posts with label setTintColor. Show all posts
Showing posts with label setTintColor. Show all posts

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.

Monday, June 10, 2013

UITabBar setTintColor example in Objective C (iOS).


UITabBar setTintColor

The tint color to apply to the tab bar background.

@property(nonatomic, retain) UIColor *tintColor

UITabBar setTintColor example.
for me its very simple to change the color of Tabbar like :-

[self.TabBarController.tabBar setTintColor:[UIColor colorWithRed:0.1294 green:0.5686 blue:0.8353 alpha:1.0]];

[self.TabBarController.tabBar setTintColor:[UIColor "YOUR COLOR"];

Example of [UITabBar setTintColor].
self.tabBarController.tabBar.tintColor = [[UIColor alloc] initWithRed:0.00
                                                                green:0.62
                                                                 blue:0.93
                                                                alpha:1.0];

UITabBar setTintColor example.
- (void)createTabBar:(NSArray*)arguments withDict:
(NSDictionary*)options
{
    UIColor *myNewColor = UIColorFromRGB(0xCD2626);
    tabBar = [UITabBar new];
    [tabBar sizeToFit];
    tabBar.delegate = self;
    tabBar.multipleTouchEnabled   = NO;
    tabBar.autoresizesSubviews    = YES;
    tabBar.hidden                 = YES;
    tabBar.userInteractionEnabled = YES;
        tabBar.opaque = YES;
    tabBar.tintColor = myNewColor;

        self.webView.superview.autoresizesSubviews = YES;

        [ self.webView.superview addSubview:tabBar];

End of UITabBar setTintColor example article.