UINavigationBar has a _UINavigationBarContentView with a wrong height

Hi all,


I'm currently debugging one of my iPad apps where the main view has a UINavigationBar (UIBarPositionTopAttached), with a frame of (0 20; 768 44). For some reason the contained _UINavigationBarContentView has a frame of (0 0; 768 50).

Should I consider this to be a bug or is there something new I'm not aware?


Dirk

The height of navigation bars, toolbars and tab bars has been changed in iOS 12 on iPad to 50 points. It seems very deliberate, despite not being announced anywhere I could find. That would explain why you see a taller bar, but not why you are now seeing origin.y == 0.

(Posting this response separately, because this link will probably require moderation and take a while to appear).


For more information see https://medium.com/@hacknicity/ipad-navigation-bar-and-toolbar-height-changes-in-ios-12-91c5766809f4

Hmm, this is not a UINavigationBar controlled by a UINavigationController but just a bar load from a nib file, so it's hight is still 44 px. It's just the _UINavigationBarContentView being wrong. The origin.y == 0 is because the _UINavigationBarContentView is a subview of UINavigationBar, which is correctly located at y == 20.


Dirk

UINavigationBar has a _UINavigationBarContentView with a wrong height
 
 
Q