I\'m trying to understand how the view
associated to a UITabBarController
, UINavigationController
or UIViewController
rea
Your regular UIViewController example has [wantsFullScreenLayout
] set to NO, which causes the view to be automatically sized so it doesn't go under the status bar.
UINavigationController and UITabBarController, on the other hand, default wantsFullScreenLayout
to YES. So their views take up the whole window, and they size and position their subviews themselves to appropriately handle the status bar. If you explicitly set the property on these controllers to NO, you should get the behavior you desire (but will then lose the ability to properly handle child controllers that set wantsFullScreenLayout
to YES, if you care about that).
In your UITabBarController example, BTW, it seems that you are not printing the information for the view of the tab bar controller; here that is a UILayoutContainerView, not a plain UIView.
The height of the view when the In-call status bar is toggled depends on the way it's anchored.
Play around with the autoResizingMask of the UIView to control whether the view should move down or resize when the in-call status bar shows up.
These two properties,
UIViewAutoresizingFlexibleTopMargin
UIViewAutoresizingFlexibleHeight
will help you. The first one pushes the view down, the second one changes the size.
Ideally you should forget about how much amount the view gets resized and play around with Autoresizing mask.