I'm updating my custom "iAD Banner Controller" to support iOS 7.
It's basically an UIViewController
container composed of 3 views:
- the main view (the view of the contained controller)
- the banner view
- a status bar background view
When the AD is available, there is an animated transition that makes the banner view and the status bar background view appear sliding from the top.
This is all managed using autolayout, and should appear like this (the status bar background is the green one, and in this case it contains an UINavigationController
):
The problem is this: Using UINavigationController as the contained controller, when the banner is not visible, the nav controller extends 20px under the status bar. This is ok and expected. But, when I move it's superview (the container) down to let the iAD banner appear, the 20px extension remains there, with this result:
However, if I do something like rotating the interface, the nav controller detects that the status bar is "far", and then adjusts itself.
I tried to call setNeedsStatusBarAppearanceUpdate
and layoutIfNeeded
respectively on the controller and it's view, without results.
I attach the whole project if you want to have a look: Link to the project