Change statusbar tint colour - ios

Is there a way to set the status bar tint colour?
I have my navigationbar tint set to brown and when it's on screen it also changes the statusbar to brown, however on views that I hide the navigationbar the statusbar returns to its original colour.
How can I change the statusbar tint colour to persist trough the application?

There is no way in iOS 5. You can just change your bar style.
But if you take a look at new WWDC 2012 Sessions, you may find something interesting)
Session number 216 - Advanced Appearance Customization on iOS

Maybe keep the notification bar there but cover it up? If the notification bar's color influences that of the status bar, then it would lead me to believe that it just has to be in the window (even buried under another view) to change it.

There is no way in iOS 5 or ealier version of ios.
now ios 6 have feature to change status bar tint color or it will set according to navigation bar pattern Image
But u can use Custom Status Bar

What I do in screens that have no navigation bar is to put in a navigation bar at the top but behind the visible interface. The navigation bar is not visible to the user, but it is visible to the system and causes the status bar to adopt its color.
EDIT: Sorry, I see now that someone else had already suggested this. So I'm just confirming that it does work.

Related

Navigationbar Color confusion

Environment: Xcode 8 and iOS 10.
I am try to set navigation bar color without writing codes.
This is my main UI color when the app is launched. I plan to set the Navigation bar with the same color. However, the color is a little light when it is tested.
As you can see, the color in Navigation bar is a light shade. I set the navigation bar color in the property attribute.
How to resolve this? Thanks in advance.
In attribute inspector, try unchecking Translucent property. And set Bar Tint property to your desired color.

Status bar color is different to UINavigationBar color

I have a custom UINavigationBar which I am using to remove the gradient of the navbar in iOS 6. Though the color of the status bar is equal to the color of the screen opposed to the color of the bar
Is there a way to make them the same color or at least make the status bar black. My problem is in ios7.
Also if I change the style of the UINavigationBar translucent to NO like this:
self.navigationController.navigationBar.translucent = NO;
Then the status bar goes completely black with no writing on it.
In your project info plist, change UIViewControllerBasedStatusBarAppearance value, if there is no, then add this key.

Move navigation bar in navigation view controller in ios7

I want add 20 points margin to my navigation bar. I need it because I want another background color under status bar as youtube did:
I found
iOS Developer library says: Status bar background appearance provided by the window background, if using UIBarPositionTop.
I found solution for toolbar, but I can't move my navigation bar inside navigation view controller. I just set UIBarPositionTop for my navigation bar, but it changes nothing.
-(UIBarPosition)positionForBar:(id<UIBarPositioning>)bar {
NSLog(#"position method called");
return UIBarPositionTop;
}
I still see the gray background of status bar instead of white.
Is it possible to do it with a navigation bar or should I use a view with a toolbar?
(XCode 6, development target 7.0+, sdk 8.0, autolayout)
UPDATE: ANOTHER WAY TO RESOLVE PROBLEM
I read this question
and understood, that there is no need to add margin. I added view with background color I need over my navigation bar controller and it resolved my problem.
When you are adding your UIView to the UIWindow, you should change the UIViews size to not underlap the title bar. How to do this is well documented in this post:
Offset on UIWindow addSubview
I hope i understood correctly, look in size inspector, ios 6/7 deltas.
Check this link for an explanation:
Interface Builder: What are the UIView's Layout iOS 6/7 Deltas for?

Why can't I set the navigation controller background color in the storyboard?

I don't understand why the background color setting in the storyboard doesn't work for my navigation controller? (See picture)
http://ctrlv.in/299323
I have here set it to bright red but as you can see it does nothing in the storyboard or to the app when I build it.
Any thoughts?
I know I can set the color programmatically, and this is what I am currently doing. However, it would be nice to see the changes in the storyboard so I don't have to build the app every time I make a color change to see the difference.
Yes you can. Notice that you're changing UIView properties not Navigation bar. Look at the screen below:
You have to set Bar Tint property.

navigation bar gets under the status bar in 4" screens

I embedded a navigation controller in a tab bar controller, the problem is that the navigation bar (with the blue color) get under the status bar. So the status bar appear transparent because it shows what is under. Here is a screenshot:
I tried to modify the status bar directly in Attributes Inspector to black and Translucent black, also disabled autolayout although i know it has nothing to do with such issue. Anyway, nothing is fixed. I used to work with that in iOS5, but since iOS6 and the new 4" storyboard screen, i got this issue.
There is a misunderstanding here. The navigation bar is not "under" the status bar. This is iOS 6's new color-adopting status bar. You can read more here.
If you do not like this behavior, your only option is to make the status bar black. Take a look at the project properties page.

Resources