I am using the iOS7 custom transitions to modally present a new view controller.
The new view controller is a navigation controller.
The controller animates up from the bottom, while the background view blurs.
My issue is that the navigation bar on the new controller, while animating upwards, appears to allows for a status bar, ie it seems to be 64 points high. When it has reached its final location and called completeTransition it realises no status bar space is required and snaps back to 44 points.
Is there a way to
While animating:
Animation complete:
The trick was to add the view of the presented view controller to the container view AFTER setting its initial position off the bottom of the screen. This prevents the container view from thinking it is at the top of the screen and automatically laying out with status bar provision accordingly.
It is related to the following from WRESTLING WITH STATUS BARS AND NAVIGATION BARS ON IOS 7:
"UINavigationController will alter the height of its UINavigationBar to either 44 points or 64 points, depending on a rather strange and undocumented set of constraints. If the UINavigationController detects that the top of its view’s frame is visually contiguous with its UIWindow’s top, then it draws its navigation bar with a height of 64 points. If its view’s top is not contiguous with the UIWindow’s top (even if off by only one point), then it draws its navigation bar in the “traditional” way with a height of 44 points. This logic is performed by UINavigationController even if it is several children down inside the view controller hierarchy of your application. There is no way to prevent this behavior."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With