I have slideshow developed for iOS 5, now im going to port it to iOS 4.3, when it show in full screen need to hide status bar in iOS 5 it is working properly but in iOS 4.3 status bar goes hidden but shows white stripe on top of view.the problem is how to hide statusbar in iOS 4.3 without white stripe.
This is the code use to hide status bar
Method 1
[[UIApplication sharedApplication] setStatusBarHidden:YES];
Method 2
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
method 1 or method 2 didn't worked for ios4.3.
write down the code in which view controller u want to hide the Status bar.
-(void)viewWillAppear:(BOOL)animated{
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
}
If you haven't figured this out yet, you'll also need to make sure that every involved view controller xib has the "Status Bar" set to none.
Related
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.
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? )
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.
tl;dr: User interface layout is broken when rotating the iPad while taking a photo, if the app displays a status bar.
I've got an app that shows a status bar that should take photos through a UIImagePickerController.
I'm running this on an iPad 3, iOS 6 with Xcode 4.51
The first problem I noticed was that if I didn't hide the statusbar via
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
before the call to
[self presentViewController:imagePicker animated:YES completion:nil];
Then the UIImagePickerController would not be shown correctly on the screen. The space for the status bar would still be reserved (but no time or battery information etc. shown) with the result that the controls at the lower end of the screen would be partly off-screen.
So, I added the line
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
before presenting the UIImagePickerController and the first problem was solved.
Now comes the second problem (caused by the solution to the first problem). When I bring up the UIImagePickerController, rotate the iPad and close it (via "cancel" or "use", doesn't matter), the handler (either imagePickerControllerDidCancel or imagePickerController:didFinishPickingMediaWithInfo: gets called, in which I show the status bar again, via
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
The problem is now that the status bar is shown in fact, but the rest of the app seems to be unaware that it is on the screen again. (The UIToolbar that I have on my "MainViewController" is partly hidden behind the status bar.) The interesting thing is, if I rotate the iPad to any other orientation all is displayed correctly again after the animation finishes.
Can anybody give me any tips on how to solve this problem? (Currently my best work around would be to leave the status bar hidden after the first time somebody took a photo, but that's kind of sub-optimal). Maybe there is a better solution to the first problem, or maybe a method to solve both issues.
Further information: After rotating the iPad to landscape while UIImagePickerController was active, this is the frame of my MainViewController's view frame: {{0, 0}, {1024, 768}} (i.e. in the case where there is the problem). When I have the iPad in landscape orientation all the time, this is the MainViewController's view frame after the UIImagePickerController is dismissed: {{0, 0}, {1024, 748}} (This is the case where there is no problem.)
Thanks in advance for your attention and effort!
I just came across the same issue on iPhone when displaying an image picker that takes an image from the camera. The solution I found was to make a call to show the statusbar when the view that popped up the image picker will re-appear. Eg.
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];
}
i'm working on a jailbroken iphone with iOS 5.0.1, just want to access status bar image,
and my code is as follows:
-(void)addStatusBarImage
{
NSLog(#"addStatusBarImage");
[[UIApplication sharedApplication] addStatusBarImageNamed:#"sgtest" removeOnExit: YES];
}
-(void)removeStatusBarImage
{
NSLog(#"removeStatusBarImage");
[[UIApplication sharedApplication] removeStatusBarImageNamed:#"sgtest"];
}
my problem is, the add function works fine, but removeStatusBarImageNamed seems useless as the "sgtest" image still exists in the status bar unless my app is terminated.
status bar icon manager fix what thread have had set icon image. if another thread try to remove that icon, it fails. You need to do it in one thread.
Check out SpringBoardAccess project at github. You can use it as is or implement like.