IOS 7 Status bar keeps appearing - ios

I have used the two methods to remove the status bar ( the one with the time and the signal strength )but it keeps reappearing in my app for IOS 7
I have used the ' hide during application launch ' in GENERAL SETTINGS
I have added the ' status bar is initially hidden' BOOL to YES
I have changed the status bar to NONE in every View Controller
The problem occurs when i return after having accessed the IPHONE photo library to import a picture into my APP , and only then , it seems to override any previous entries in the PLIST
Does anyone have any code to permanently disable this status bar so it does not appear?
Thanks
* I have tried all the options listed but still when my app returns from opening and selecting from the photo gallery the status bar re-appears *

You need implement 2 steps for to hide status bar accross your app:
1) didFinishLaunchingWithOptions
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[[UIApplication sharedApplication]setStatusBarHidden:YES];
.......
}
2) And .plist file of your project

Add method in your view controller implementation.
- (BOOL)prefersStatusBarHidden {
return YES;
}

You can get rid of this by adding an entry in the .plist file of your project
"View controller-based status bar appearance" set its boolean value to "NO"

Related

Detect Blue flashing status bar in ios programmatically

When google map is using location service and we go to background then one status bar with blue flashing background with information "Google map is using your location" is coming.
Now when I open my application (or any other application) you always see that blue flashing bar .
My question is can I detect that status bar is with blue flashing information is active now or not programmatically?
UIApplicationDelegate has these 2 methods
- (void)application:(UIApplication *)application willChangeStatusBarFrame:(CGRect)newStatusBarFrame; // in screen coordinates
- (void)application:(UIApplication *)application didChangeStatusBarFrame:(CGRect)oldStatusBarFrame;
You can refer this link for more details.
Detecting if user has in call / Any Activity status bar
Hopefully, it'll help you.Thanks.

Adding view controller as launch screen

I am working on a launch screen where I want to add a progress bar.
LaunchScreen.xib doesn't allows me to add a progress bar on the launch screen.
So is it possible to add a view controller as the launch screen for some time interval so I can add a progress bar on the launch screen of my project?
No,you can not. You can not add any logic code to it.
And also know that, at launch screen time. Your app is not launched at all. So your code about progress bar is not running.
I think the better way is using a launch screen first,then show a viewController with a progress bar as you like.
Treat launch screen as progress indicator and do loading stuff before return "Yes" in applicationDidFinishLaunchingWithOption.as return yes line executed then view controller load it's view. but don't try too much stuff before return yes like time consuming network operation.
Yes, you can. I wanted to have control how long the LaunchScreen is visible when launching the app which I did in the didFinishLaunchingWithOptions in the AppDelegate.m file.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
int time = 3;
sleep(time);
printf("[%i] %s ***** sleeping %i seconds *****\n",__LINE__,__FUNCTION__, time);
return YES;
}

UIImagePickerController hiding status bar iOS 8

I want the status bar hidden in my app. In my pList I have set:
Status Bar is initially hidden - YES
View controller-based status bar appearance - NO
This works fine until I present an UIImagePickerController. It wants to show the status bar. So in willShowViewController for the navigationController delegate I call [[UIApplication sharedApplication] setStatusBarHidden:YES]. This does in fact hide the status bar but there is a shifting like an animation in the navigationController. I've spent some time trying to stop this animation. Anyone have any ideas how to stop it? Thanks.
Try it
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
Subclass UIImagePickerController and define prefersStatusBarHidden method, return YES if you want to hide a status bar.
It turns out that this a bug in iOS 8. I filed a radar bug and Apple suggested I try the beta 8.3. With the beta I no longer see the animation.

iOS 7 red status bar

When Shazam is opened the status bar turns red and doubles it's height because of background recording, but this ruins the UI in my app. I'm now trying to change my code to support different status bar sizes, because the red status bar is also opaque, but I can't come up with a general solution because of this:
When the status bar is initially red, when I launch my app, the launch image is scaled and ruined. How to fix this?
Note: My app does NOT use recording.
[Edit]
The only solution I found was to set 'Status bar is initially hidden' to YES in .plist. I don't really need the status bar to be visible on app launch, especially if it affects my launch image when the status bar is taller than usual, i.e. when recording or during a phone call.
[Edit 2]
There are cases when the launch image will be briefly visible when the app is brought to foreground from background state. To work around this I use view-controller based status bar appearance:
- (BOOL)prefersStatusBarHidden
{
if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground)
{
return YES;
}
return NO;
}
This ensures the status bar is always hidden when the app comes to foreground, so the launch image will never be affected. Don't forget to call setNeedsStatusBarAppearanceUpdate on appDidEnterBackground and (inside an animation block) on appDidBecomeActive notifications.
The red status bar is a system function. You are not going to be able to work around this - and it isn't really your 'fault' if the launch screen looks like that - if the user wants to open your app while using Shazam, they are going to see the red bar and the launch image is going to be scaled. You could change the launch image to look good when scaled, but then it would look bad the rest of the time (when the red bar wasn't at the top of the screen on launch).
After a long long long long long research and hurdles I found out simple solution for this follow as below
In Targets->General->Deployment Info check the HideStatusBar Option
like below!
And in the ViewController (Which one you kept as RootViewController) in viewDidAppear add this line of code...
[[UIApplication sharedApplication] setStatusBarHidden:NO];
Because when you uncheck HideStatusBar Option and your app needs any background process or audio related process then the status bar will become red with enlarged height. If you dont want status bar in entire app then dont add the above line in viewDidAppear and check HideStatusBar Option.

Enable iOS notification center, but keep the status bar hidden?

I want my application to not show the iOS status bar. I can do this in AppDelegate.m like so:
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
application.statusBarHidden = YES;
return YES;
}
This hides the status bar great, but makes the iOS notification center and the iOS control center take 2 swipes to pull in. I do not want this behavior.
Any help would be fantastic. Thanks!
I'm sorry for the half-hearted answer, but I don't have enough rep to comment. Basically your app thinks it's in fullscreen mode, and that requires a 'double' swipe to bring up control center og notif-center. So you'll have to find a way to overwrite that default fullscreen behaviour

Resources