0

I am trying to determine if the StatusBar is being displayed when my iDevice is in landscape. I have overridden viewWillTransitionToSize so that I can recalculate the view layout, but cannot find any property to show StatusBar status:

self.status.statusBarHeight

always returns 20, and only the description seems to have anything useful.

self.topLayoutGuide.description

returns

_UILayoutGuide: 0x7fdaa16aec20; frame = (0 0; 0 20); hidden = YES; layer = <CALayer: 0x7fdaa16ac650>>

If the device is about to rotate to landscape and

_UILayoutGuide: 0x7fdaa16aec20; frame = (0 0; 0 0); hidden = YES; layer = <CALayer: 0x7fdaa16ac650>>

If the device is about to rotate to portrait.

The fact the the heights returned are incorrect leads me to believe they are not updated properly until after the function.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
IanH
  • 1
  • 1
  • Have you tried shifting this logic to `viewDidLayoutSubviews()`? This should also be called whilst and after rotation and I figure you want to know the statusbar height for layouting purposes. – Ted Huinink Apr 13 '16 at 09:05
  • check out this http://stackoverflow.com/questions/12991935/how-to-programmatically-get-ios-status-bar-height – Tyson Vignesh Apr 13 '16 at 11:27

0 Answers0