Hiding status bar completely - iphone

I hide the status bar in applicationDidFinishLaunching using
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
That works fine except the status bar is there while the app is loading. Meaning, when the default.png is displayed, I see the status bar. Is there a way to have the status bar not show at all?

Add UIStatusBarHidden to your info.plist file, set to true. Documentation here:
http://developer.apple.com/library/ios/ipad/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html

You need to use this:
[[UIApplication sharedApplication] setStatusBarHidden:YES];
and then open up the info.plist file, create a new line, chose Status bar is initial hidden and set it to true.

You need to edit your Info.plist to include the entry "Status bar is initially hidden" and set the value to YES.
For more information:
http://www.idev101.com/code/User_Interface/StatusBar.html

Related

Hide Status Bar from iPhone application

I want my app to not have the status bar at all! I have tried using the .plst
I have tried everything in here Status bar won't disappear
and also in here
How to prevent iOS 5 from showing the status bar even though UIStatusBarHidden is YES?
Can someone go into extreme detail to help me? I am using XCode 5 if that helps. I just want the status bar to be gone from the app!
Thanks!
iOS 7
In your Info.plist file add key View controller-based status bar appearance with value NO. And, add key Status bar is initially hidden with value YES.
To hide the status bar after the app has completely launched, change it programmatically by adding this line to your app delegate's applicationDidFinishLaunching method:
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
If you set animated to YES then the status bar will disappear by fading out. One question, why do you want to delete the status bar?
in your "*project_name*-Info.plist" file, add a key named "Status bar is initially hidden" and then set the value to "YES". that will always hide the status bar.
//viewDidload
if ([self respondsToSelector:#selector(setNeedsStatusBarAppearanceUpdate)]) {
// iOS 7
[self prefersStatusBarHidden];
[self performSelector:#selector(setNeedsStatusBarAppearanceUpdate)];
} else {
// iOS 6
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
}
// Add this Method
- (BOOL)prefersStatusBarHidden
{
return YES;
}
Have you tried this:
click on .xib file -> attribute inspector -> change 'Status Bar' to 'None'
(refer attached image)
Open your application Info.plist file and add the following lines:
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIStatusBarHidden</key>
<true/>
Please add this to your view controller
- (BOOL)prefersStatusBarHidden {
return YES;
}

Hiding status bar iOS 7

Can't hide status bar on view controller on ios 7 device.
Already tried setting through plist file and also in Appcontroller.mm but still i doesn't hide the status bar
[[UIApplication sharedApplication] setStatusBarHidden:YES];//Doesn't help
Go to info.plist and add two attributes if not present. set "Status bar is initially hidden" to YES and set UIViewControllerBasedStatusBarAppearance to NO. This will hide status bar for your app.
That's because iOS 7 has changed the way it deals with the status bar.
Setting UIViewControllerBasedStatusBarAppearance to NO on your app Info.plist should work.
I had the same issue recently. Be sure that you are targeting the correct view controller. Try to hide the status bar in the root view controller. Also, I´m implementing the method (BOOL)prefersStatusBarHidden (doc) in my UIViewControllers to hide the status bar. By using this method, you can forward the preferred configuration to a "child view controller". Also, this method works fine in UIViewControllers presented as modal.
// for ios 7
- (BOOL)prefersStatusBarHidden
{
return YES;
}
// for ios 6
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}
For iPad (iOS 7.0) need to put another value at Info.plist file.
UIStatusBarHidden boolean value YES.

How to show status bar initially hidden from plist iphone

i want to hide the status bar when i launch my app to view launch image that was covered by status bar. so in plist i added
Status bar is initially hidden YES
and status bar is covered.
My problem is that status bar is covered always in my app, i want to hide status bar only for launch image, what can i do?
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
SOLVED
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO];
using this at launch of app :)
you can do this by adding property, "Status bar Initially Hidden" to plist as shown below : -
OR
you can also set the (Status bar Initially Hidden)Property to "NO" in Info.plist file in your Application.
Just uncheck this property.
Neither Niko's nor JackTurky's solutions are correct. Niko's:
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
...works but is deprecated. Correct in iOS 3.2 and later is:
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];

How to get a black status bar on an iPhone app?

I want to use a black status bar for my iPhone app. I have selected black status bar on all of my .xibs but I still can't get it to be black. Is this an issue that anyone else has seen or knows how to remedy?
Open the "info.plist" file .
Add a new row.
Select "Status bar style" as the key.
Select "Opaque black style" as the value.
EDIT: The comment by #codrut below to choose the value:
If you go far to the right, there's a button that brings you a drop down with the possible options.
The status bar in the nib files is there as an indication, just to simulate the real interface.
What you need to do is:
[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackOpaque];
and in the plist change the Status Bar Style (UIStatusBarStyle) to Black opaque (UIStatusBarStyleBlackOpaque) (or whatever you want).
Add the following in the info.plist file
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleBlackOpaque</string>
Not sure if this will help anyone else, but in our app we ran into an issue where the only way we could get it to use the black style was if we set it to the default style:
[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleDefault];
Might be worth giving that a try if BlackOpaque isn't working for you.
Try this simple method....
1.For single viewController
[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackOpaque];
2.For whole application
info.plist
----> Status Bar Style
--->UIStatusBarStyle to UIStatusBarStyleBlackOpaque

Write some text in (or on) UIStatusBar

I know, it's a strange question ^^,
I would like to know if there is a way to write some text in (or on) the UIStatusBar. In particular I want to write some text on the Status Bar when the user press a UIButton.
Thanks!
I'm not sure if you can draw directly into the status bar, but you should be able to draw on top of it in a custom view. You can get the status bar's frame using:
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
And you can get the application's main window (presumably the status bar's superview) using:
UIWindow *mainWindow = [[UIApplication sharedApplication] keyWindow];
You should be able to add your custom view directly to the key window in the status bar's frame. For an example of an app that appears to "modify" the status bar, take a look at Reeder.
No, the status bar is a system-controlled element. It's content cannot be modified by a third-party application.
Check out this work in progress: https://github.com/maciekish/APStatusBarExtensions
MTStatusBarOverlay is what you want :
https://github.com/myell0w/MTStatusBarOverlay
Definitely the easier to use !