Hello when my application is running at that time status bar height increase this problem occur only in ios8 otherwise all is working perfectly. So please help me to solve this problem. I am new in iPhone.
You can trey this.
Status bar height is, indeed, equals 20.0f points except following cases:
status bar has been hidden with setStatusBarHidden:withAnimation: method and its height equals 0.0f points;
as #Anton here pointed out, during an incoming call outside of Phone application or during sound recording session status bar height equals 40.0f points.
[UIApplication sharedApplication].statusBarFrame.size.height.
I found this in forum.
Related
I have a custom navigation bar that worked well until iOS 11. It appears smaller than it should and seems to ignore the status bar height or something.
I set the whole thing programmatically and the height is set to 64.
have you tried to disable (untick) safe area?
I have a UIViewController subclass which when I run the app on iOS 7, the status bar shows on top of my view. Is there a way to avoid this? I do not want the status bar to be hidden. Is there a way to show the status bar above my app. I present my view using presentViewController. Please guide what I am missing?
In Xcode, In storyboard there is an option of iOS6/7 delta. set delta Y to 20 pixel of your view, to make compatible with iOS7.For this you have to disable auto layout, you can use auto resizing.
This is quite common issue. Starting from iOS 7 Status Bar is a part of the controller's view. Apple even have added special attribute of UIView in the Interface Builder: iOS 6/7 Deltas. To fix your problem and make your view look the same in different iOS versions, go to Size inspector and set Delta Y to 20.0.
I'm porting my app from iOS 6 to IOS 7 (there will eventually be a complete GUI redesign for iOS 7 but in the meanwhile just getting the existing GUI to display properly on iOS 7 is the goal.
I had the issue where the status bar was overlapping my GUI and so have shifted the Y origin of the view controller's view down by 20.
However my app contains a pulldown which when retracted is overlapping with the status bar. In the screenshot the red is a button which is present in the pulldown view. The grey bar is the top of the main view behind which a portion of pulldown is hiding when retracted.
I implemented the pull down as a fixed size child subview of the main view and when retracted its Y origin is a negative number thus it is effectively still displayed but off the top of the screen. When the user pulls it down I just animate the increase in the Y origin until eventually the origin is 0.
Is there some way I can make the pull down view appear beneath the status bar or some other quick solution?
Note of course I can't simply toggle the pulldown's alpha to display/hide it as it pullsdown obviously thus its appearance/disappearance is not a discreen action. I could maybe attempt to make the portion of it that is on top of the status bar invisible but as its something that is moving that seems like its going to be complicated. Is there any simple solution?
Thanks
Add another view, with a fixed position, under the status bar (with the same color of your grey bar), 20px tall and same width of the status bar, but with a z-index higher than the retracting view. This view will cover the retracting view (but not the status bar) acting as a "background" for the status bar itself. Obviously you have to adjust the Y position of the retracting view to make it tappable by the user (but under the status bar)
iOS 7 by default lets views take up the fullscreen, including the status bar. This is controlled using the UIRectEdgeAll property.
If you want the old style view, set UIRectEdgeNone for self.edgesForExtendedLayout
in viewDidLoad:
self.edgesForExtendedLayout = UIRectEdgeNone;
Not sure about the title of this question... it's a work in progress.
Anyway, while the internets are full of folks that want to make their ios7 status bar behave the old way, i'm fine with that. However, my problem now is that the view that starts at y=0 in IOS7 jumps down under the status bar in IOS6.
I can and have solved this with the 'delta' ios6/7 thing in interface builder, but i would rather have my views behave exactly the same way, i.e. my top 20 pixels can be seen in IOS7, but are hidden by a black bar in IOS6. This means that all objects end up in the same Y position before and after IOS7 if you see what i mean.
I've tried all sorts of stuff to no avail. Is there an easy way to tell xcode that i want my view to start at position 0 and disregard the statusbar in IOS6?
Just try this in all view's viewDidLoad
self.wantsFullScreenLayout = YES;
If it's disabled, how do I know its height?
You can get statusbar height by using -
local statusBarHeight = display.statusBarHeight
"statusBarHeight" will store its height.
UPDATE : New Method...
display.topStatusBarContentHeight
This method will also return the value of the status bar in 'content pixels' and is to be used in replacement of the old and now deprecated method 'statusBarHeight' - the key difference being it now supports Android.
Now Deprecated...
display.statusBarHeight
This method will allow you to read the value of the status bar height in 'content pixels' though it is exclusive to 'iOS Devices' on Android devices it will return an incorrect value of 0 regardless of the height of the status bar.
Status Bar Height = display.actualContentHeight - display.contentHeight