I have tab bar as shown in attached figure. I would like to make this blue color ,which I believe default, to green. Is there way to make it ?
You can use this at your view controller.
[[self tabBarController] tabBar].tintColor =[UIColor greenColor];
Related
I'm setting the tint color of a window to an arbitrary color, then trying to over-ride this on a per-button basis, but it appears that the buttons revert to the window tint color whenever there is a segue applied on them.
Setting tint color in didFinishLaunchingWithOptions:
self.window.tintColor = [UIColor redColor];
and then my two buttons in viewDidLoad:
[self.button1 setImage:[[UIImage imageNamed:#"711-trash"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateNormal];
self.button1.tintColor = [UIColor purpleColor];
self.button2.tintColor = [UIColor blueColor];
where button1 is a custom type button and button2 is a system type button.
When the popover first presents, the two buttons are tinted purple and blue. But when the segue view controller is pushed, the popped, the two buttons switch to red. Is there any way to prevent this?
EDIT:
I've tried reproducing your code like this:
However everything worked as expected:
So I agree with #user3779315, possibly you are setting the buttons' tint color somewhere else. Btw, additional code of your project would help to clarify the issue :-)
I have a view that I'm trying to 'dim'. I'm creating a UIView with a black background color and alpha of 0.4. I lay this view over my view, and I also change the color of my of navigationbar by change the RGB values (the correct way to get this is to take the RGB value and multiply it by 1.0-0.4 to get 0.6. Anyway, that's beside point).
I want to 'dim' my main view, and 'dim' the UINavigationBar... but I don't want the status bar to be 'dimmed'.
However, I can't figure out how to do this. When I change [self.navigationcontroller.navigationbar setBarTintColor:
Is there a way to set the colors individually?
Yes you're on the right track, You can set the color of the bar by using these methods, the barTintColor
//Navigation Bar
[self.navigationController.navigationBar setTitleTextAttributes:#{NSForegroundColorAttributeName : [UIColor whiteColor]}];
self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:53.0/255.0 green:53.0/255.0 blue:53.0/255.0 alpha:1.0];
I have getting navigation bar color and set it to view as background color but it's not as same as the color in bar.
I don't know why it's doing so.
Your solutions are welcome and i hope you help me in that matter.
CODE
self.navigationController.navigationBar.tintColor = [UIColor blueColor]
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0,0,20,20)];
view.backgroundColor= self.navigationController.navigationBar.tintColor;
In my application design we have same theme that's why it's not getting the theme of navigation view background color
there is some difference.
Use -[UINavigationBar barTintColor] property instead of tintColor
PS. Be aware of translucency :)
i have situation where i need to have blue color as navigation bar color for first view and for second view i should have as green color .when i tried to apply it using below code.
in viewdidload for 1st view:
self.navigationController.navigationBar.barTintColor = [UIColor bluecolor];
in view did load in second view:
self.navigationController.navigationBar.barTintColor = [UIColor greenColor];
the color remains same as in first view i was unable to change it,and how to remove glassy effect on navigation bar.
Select your navigation controller in your view hierarchy(in Storyboard), select the navigation bar and from there you can set the color in the attributes inspector.
I need to set UIPopover background color to clearColor. But rest of all colors are working fine with below code:
myPopover.backgroundColor = [UIColor greenColor];
but when I set clearColor, there is a white background instead of transparent.
Can any one help me. Thanks in Advance!
If what you're talking about is a UIPopoverController, then try setting the background color to its content view controller's view.
myPopover.contentViewController.view.backgroundColor = [UIColor clearColor];
Also, check this SO post about custom popover backgrounds.