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.
Related
I am try to implement call in progress bar like wats-app call in IOS (as shown in image). The progress bar need to hover the home screen while application goes in background.
Please advice
Thanks
Amith
This bar will show up automatically when your app is working in background mode.
The color will between red and blue depending on the background task you are performing.
Note: Some background modes doesn't show this bar (like audio playback for example).
Goto to project -> target -> capabilities
Select "Background Modes" check Voice over ip if you want to implement call like whatsapp and need a progress bar
When I let the user login into my app with Touch ID, I get the dialog (which by the way is very ugly and cannot be customized) and I also get a second status bar, which looks like this:
Is there any way to hide the status bar?
If not, set the status bar style to my style (UIStatusBarStyleLightContent)?
(I also would be very happy if someone knows of a way to customize the dialog, more than just changing labels)
i fixed this
just hide status bar when open touch id like this
[[UIApplication sharedApplication] setStatusBarHidden:YES];
not show after failure or success with perform selector with 1 sec delay like this and my code working perfectly
[[UIApplication sharedApplication] setStatusBarHidden:NO];
Did you see this behaviour on iPhone 6/6+ ?
If yes, the way I solved it was by setting the appropriate launching xib so that iPhone 6 and 6 plus devices are using the native resolution without being scaled. (see also this question on how to do that How to enable native resolution for apps on iPhone 6 and 6 Plus? )
My app sometimes uses the microphone, but even when I am not using the microphone, the red status bar appears momentarily when leaving my app.
I have set AVAudioSession's category to SoloAmbient. When I record, I set it to PlayAndRecord, and when I am done I set it back to SoloAmbient. But even when the category is SoloAmbient I still see the red status bar.
Even when my app has not accessed the microphone at all I am still getting this red status bar behavior. I do not have the app configured for background audio. Any ideas what might be making the system think that I am recording?
EDIT: After some experimentation, it looks like I can prevent the app from causing the red status bar on launch by delaying creating of the recording AUGraph until I actually start recording.
However, I still see the red status bar after stopping recording. When I stop recording, I stop the AUGraph and dispose of it and change the AVAudioSession category back to SoloAmbient. But I still see the red status bar when I switch away from the app.
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.
Is it normal to have the 'GPS arrow' in the status bar mentioning that the location service is running when using startMonitoringSignificantLocationChanges ?
Indeed, I don't want this arrow to appear in the status bar when my app is in background (because the user will think that my app reduces its battery life). But I need to track the significant position changes !
Here is the behaviour I have up to now:
My app is in foreground (no arrow displayed in the status bar)
The user clicks on the home button => I execute startMonitoringSignificantLocationChanges when entering in applicationDidEnterBackground delegate method => the arrow appears... (what I don't want!)
Please, tell me if it is normal to have the arrow in the status bar when launching startMonitoringSignificantLocationChanges and if there is a way to remove it.
Thanks !
Yes, it is normal. Your app could be woken by the OS to respond to a significant location change, and that is what the status bar indicator shows. There's a related iOS bug (Richard Groves's answer) at Locationservice Indicator stays "on". I don't know any way to suppress the status bar indication.
I have an audio recording application. And when it is recording in the background, I see a red horizontal bar on the top with my project name on it. I want to get a handle on that bar so that I can display additional things there. How do I get a handle on it and what exactly is that bar called?
If your app is not running in the foreground you don't have access to the screen, so you can't get a handle to the status bar. And even if you could, you wouldn't be able to change it.