How to get status bar height in corona sdk? - coronasdk

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

Related

IOS 11 navigation bar appears smaller than it should

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?

iOS - Resizing Navigation Bar height with detail

I want to make a navigation bar that changes height in it's detail view just like the messages app in iOS 10. How can I do that?
Edit:
I am looking to change the height dynamically. SizeThatFits() Permanently changes the height.
If you are trying to do something else that requires the navigation bar to be resized, that's not supported. iOS 11 and Above
Community bug reports

Regarding Internet Connection Tethering Bar Height

Please suggest me the way to get the height of tethering bar, showing the internet connection info. Actually when I am getting the height of status bar its returing 20, even the is tethering bar showing on the screen. So please let me know how to get the actual height of status bar and tethering bar.
Thanks & Regards
You can use CGRect rect = [[UIApplication sharedApplication] statusBarFrame] to get the status bar frame.
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/#//apple_ref/occ/instp/UIApplication/statusBarFrame

Status bar height increase in iphone

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.

self.wantsFullScreenLayout is not working on some VC

I am developing in Xcode 5, and issue happens only in iOS versions below iOS 7. I have to keep status bar visible. I am using
self.wantsFullScreenLayout= YES;
But my view is still appearing beneath the status bar.
How can i fix this so the view is not covered by the status bar?
You need to set Delta of your UIViewController 's view.
Switch Story board to ios6.1 or later from utility area (1st item).
Then select view of your UIViewController and in size inspector menu in utility area there will be delta section below frame. There will be triangle before every delta. Change Triangle y to 64 (you should be on "ios6.1 or later" of your storyboard).
This means when storyboard is opened in ios7 then your UIViewController's view will start from 64 automatically . 64 is UINavigationbar height + UIStatusbar height.
If your UIViewController dont have UINavigationBar then Delta y = 20,(you should be on "ios6.1 or later" of your storyboard).
Once you change delta's in one ios it will automatically change its opposite.
If you need help on Deltas visit : Interface Builder: What are the UIView's Layout iOS 6/7 Deltas for?
What iOS version are you targeting?
Do you want your view under the status bar or the status bar removed completely? If you want to get rid of the status bar
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
Are you targeting iOS 7? if so you can use this to hide the status bar
- (BOOL)prefersStatusBarHidden
{
return YES;
}

Resources