iOS7 No barTintColor on launch - ios7

When I open my app, during the new animation of io7, the navigation bar is transparent and black without the color that I chose for barTintColor until the app loads. Why is this?

This was happening because the self.navigationController.navigationBar.translucent was YES. Setting it to NO fixed the problem. It also changes the color of my barTintColor and I had to adjust accordingly just FYI

UIColor *NavBarTintColor = [UIColor colorWithRed:0.223 green:0.223 blue:0.223 alpha:1.000];
[self.navigationController.navigationBar setTintColor:[UIColor lightGrayColor]];
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:#"Image.png"] forBarMetrics:UIBarMetricsDefault];

At ios7, I use below code to set the color and it worked for me:
myNav.navigationBar.barTintColor = [UIColor redColor];

Related

Navigation bar keeps turning into gray despite changing it to white. Why?

I'm using this code to turn the "Back" button on a navigation bar to white, but it keeps making it gray.
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
I also tried this:
[[UINavigationBar appearance] setTintColor:UIColorFromRGB(0xFFFFFF)];
I've also tried (I found it in another question):
[[UINavigationBar appearance] setTintColor:[UIColor colorWithWhite:1.0 alpha:1.0]];
None of them work! They keep making it gray! If I try red/black/green or another color, they work, but white keeps turning into gray.
Try it like this...
UINavigationController *controller= [[UINavigationController alloc]
initWithRootViewController:YourViewController];
controller.navigationBar.tintColor = [UIColor whiteColor];

How can I make my navigation bar uniformly semi-transparent?

I'm writing an app on iOS 7, and I can't seem to get a handle on the transparency of the navigationBar and the toolbar, how can I set the navigation bar to black at 50% opacity?
I've read the transition to ios7 guide and I've watched the wwdc13 lecture 214, but my status bar still has a different transparency than the rest of the attached nav bar.
Here is my code:
// APP-WIDE THEMING
[[UINavigationBar appearance] setBarStyle:UIBarStyleBlackOpaque];
[[UINavigationBar appearance] setBackgroundColor:[UIColor blueColor]];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
Here is the screenshot of my problem: http://grab.by/qiyU
Set the background image to nil, and set the background color with alpha.
[ctrl.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
ctrl.navigationController.navigationBar.backgroundColor = [UIColor colorWithRed:0 Green:0 Blue:0 Alpha:.5];
According to the answer posted here it's possible to create a transparent UINavigationBar:
How to draw a transparent UIToolbar or UINavigationBar in iOS7
However you want to create a semitransparent navigationbar. For that as far as I can tell you have to create a 1 px large image containing a black color with 50% opacity. Add this as backgroundimage for your Navigationbar.
This snippet should do the trick:
[[UINavigationBar appearance] setBarStyle:UIBarStyleDefault];
UIImage* sti = [UIImage imageNamed:#"EMT_SemiTransparent.png"];
[[UINavigationBar appearance] setBackgroundImage:sti forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setBackgroundColor:UIColor.clearColor];
try setting key [View controller-based status bar appearance] to NO in your pList file as well.
i've run into some funkiness with the status bar not seeming to be affected by changes in code and this solved it for me.
reference: https://stackoverflow.com/a/18184831/2962193
Set the alpha value to make it transparent.
[[UINavigationBar appearance] setAlpha:0.5f];

Remove TabBar Button glow(not on image- hiding the selection tint of button)

I've created a tabbar application,I am using a custom TabBar with a backGround image.
I have finished all the parts but unable to remove the glow of tabbar button on click(i just changing the UIButton selection on click,but glow is still there)
How to hide the glow of UITabBar Buttons(ie hiding the selection tint of buttons) ?
Now TabBar is like this..
Need tabBar like this
You can use the following code.
[[UITabBar appearance] setSelectionIndicatorImage:[[UIImage alloc] init]];
Try It.
To change tabbar tint colour
[[UITabBar appearance] setSelectedImageTintColor:[UIColor grayColor]];
This will definitely help you. Simply create an UIImage object and pass it to setSelectionIndicatorImage property .
[yourTabbar setSelectionIndicatorImage:[[UIImage alloc] init]];
[self.tabBarController.tabBar insertSubview:[[[UIImageView alloc] initWithImage:[UIImage imageNamed:#"1.png"]] autorelease] atIndex:1];
You need to set UITabBarItem appearance:
[[UITabBarItem appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:[UIColor yellowColor], UITextAttributeTextColor,
[UIFont systemFontOfSize:14.0f], UITextAttributeFont,nil]
forState:UIControlStateHighlighted];

objective C , setting the navigation bar background color

I am making a storyboard application using XCode 4.2
I am trying to set the color of the background of the navigation bar but cant find anyway to do that.
I found a way to set the text (see below), but not the title
[[self navigationItem] setTitle:#"title text"];
I would like the background of the navigation bar to be black
thanks!
UINavigationBar *bar = [self.navigationController navigationBar];
[bar setTintColor: [UIColor blackColor]];
navigationController.navigationBar.tintColor = [UIColor colorWithRed:1 green:0 blue:0.2 alpha:1];
the iOS5 has a flexible colorable ToolBar too.

UISegmentedControl alpha property not working properly

Is there a fix for this behavior?
This is a UISegmentedControl full default no special properties set at all.
Setting its alpha or the alpha of the superview shows this behavior, any suggestions or is this a bug ?
http://i.stack.imgur.com/k1L7K.png
Have the same problem :( No idea how to fix with UISegmentedControlStylePlain
But with it works with UISegmentedControlStyleBar, and you can also set a tintColor
[segmentedControl setSegmentedControlStyle:UISegmentedControlStyleBar];
[segmentedControl setAlpha:0.5];
[segmentedControl setTintColor:[UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:1.0]];