On iOS8, displaying my app in landscape mode will hide the status bar but on iOS 7 the status bar is displayed on both orientations
Try this
Add below code in didRotateFromInterfaceOrientation
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
EDIT
NO NEED TO WRITE CODE IN ALL VIEW CONTROLLER
Set View controller-based status bar appearance
to NO
in plist
and add below code in
root view controller's viewDidLoad
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
Demo project
https://www.dropbox.com/s/uumneidk4wom5md/demoStatusBar.zip?dl=0
On iOS8, displaying my app in landscape mode will hide the status bar but on iOS 7 the status bar is displayed on both orientations
Try this
Add below code in didRotateFromInterfaceOrientation
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
EDIT
NO NEED TO WRITE CODE IN ALL VIEW CONTROLLER
Set View controller-based status bar appearance
to NO
in plist
and add below code in
root view controller's viewDidLoad
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
Demo project
https://www.dropbox.com/s/uumneidk4wom5md/demoStatusBar.zip?dl=0
Issue of status bar which is getting hidden in landscape mode in ios 8 and works fine in ios 7 tried after release of ios 8 in xCode 6
This is the new default in iOS 8. But you can restore the old behavior by overriding the following in your UIViewController
:
- (BOOL)prefersStatusBarHidden {
return NO;
}
Xcode 6.x/iOS 8 Hides Status Bar in Landscape Orientation
Best possible solution
It's basically a two step process:
1). Set "View controller-based status bar appearance" to NO
, in your project's Info.plist file.
2). Force the status bar hidden status to NO
, in application:didFinishLaunchingWithOptions:
, using the following code:
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
And, voila!
Note: It's important to use both the setStatusBarHidden:withAnimation:
statements above, to force the status bar hidden state.
Reference: On iOS8, displaying my app in landscape mode will hide the status bar but on iOS 7 the status bar is displayed on both orientations
Status bar behave weird in landscape mode on iOS 8.1 and work fine with iOS 7.1
This may help you
In Plist set View controller-based status bar appearance: NO
and add the code in your view Controller
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
}
Display status bar on landscape orientation for iOS 8
I'm not sure if this is the right answer. Yet this one works but there's a glitch on iPhone6/iPhone6Plus, it doesn't get displayed upon application start.
[application setStatusBarHidden: NO];
Button not appearing in landscape mode in iOS 8
Here is a screen which show constraint needed to show button in centre in both landscape and portrait mdoe
This is a simplest thing i ever post in stackoverflow
Please check your code again and see is there any other constrains you had apply.
Note : In iOS8 status bar is hide in landscape mode and if you want to display it in landscape mode please follow my answer over here link.
Status bar and navigation bar issue in IOS7
Fix for status bar issue in IOS 7
Finally I fixed the status bar over lap issue using the delta value property in xcode5. First I have increased origin - y 20pxl to all the controller used in the Xib (it seams to be working fine only in IOS 7), after that I set the delta value for all the view controller origin -y to -20 it works fine in both iOS 6 and iOS 7.
Steps to do that.
Xcode 5 provide preview option to view the appearance of the xib in different view based on the OS version.
Choose preview option from assistant editor
Click assistant editor
and choose preview option to preview selected view controller in different version.
view controller view preview option.
in preview you can find the toggle option to preview view in different version. In preview u can feel the status bar issue clearly if its not fixed properly by toggle the version.
Three steps to fix the status bar issue:
step 1: Make sure the view target us 7.0 and later in File inspector.
Step 2 : Increase the origin - y with 20 pixel (exactly the size of the status bar) for all the controls added in the view controller.
Step 3 : Set the delta value of origin y to -20 for all the controls then only it will adjust automatically based on the version. Use preview now and feel the differ that the controls automatically adjust because of the delta value.
Once the status bar issue fixed, issue while presenting the model view (ZbarSDk controller) is also fixed automatically.
Preview screen :
Related Topics
Save and Retrieve Value via Keychain
Atos and Dwarfdump Won't Symbolicate My Address
Disable Bitcode for Project and Cocoapods Dependencies with Xcode 7
How to Change the Color of an Uiimage
Uitextview: Disable Selection, Allow Links
@Published Property Wrapper Not Working on Subclass of Observableobject
How to Manage Cookies with Uiwebview in Swift
Blocks on Swift (Animatewithduration:Animations:Completion:)
How to Use the Uisearchbar and Uisearchdisplaycontroller
iOS Nsattributedstring on Uibutton
Exc_Bad_Instruction (Code=Exc_I386_Invop, Subcode=0X0) on Dispatch_Semaphore_Dispose
Styling the Cancel Button in a Uisearchbar
Fatal Error: Init(Coder:) Has Not Been Implemented Error Despite Being Implemented
Open Uisplitviewcontroller to Master View Rather Than Detail
Xcode Cannot Run on the Selected Destination
Want to Create a Cool Static UI But:"Static Table Views Are Only Valid..."