IOS7 custom transitions with UINavigationController

I am using iOS7 custom transitions to modally represent the new view controller.

The new view controller is the navigation controller.

The controller animates from below, while the background image is blurred.

My problem is that the navigation bar on the new controller, when animated up, seems to allow the status bar to be displayed, that is, it seems to be 64 points higher. When it reaches its final location and is called completeTransition, it realizes that it does not require a place in the status bar and is discarded up to 44 points.

Is there any way

  • First, tell the navigation controller / top-level controller that a status bar is not required. OR
  • Call any method that completes the redirection before the animation, so that automatic reconfiguration is then performed.

During the animation:

While animating

Animation completed:

Animation complete

+4
source share
3 answers

The trick was to add the view of the presented view controller to the container view AFTER setting its initial position at the bottom of the screen. This prevents the container from appearing at the top of the screen and automatically sets its position with the status bar.

This refers to the following from PLAYING WITH A STATUS BATTERY AND NAVIGATION BARSES on iOS 7 :

"UINavigationController UINavigationBar 44 64 . UINavigationController , UIWindows, 64 . UIWindows ( ), " " 44. UINavigationController, . .

+7

, , , . , , .

, iOS 7

, :

[self.navigationController.navigationBar.layer removeAllAnimations];    

viewWillAppear , . , .

, UINavigationController - , .

0

UINavigationBar.

splitview ( UIKit, iOS 5.0 ), UINavigationController, , .

, , iOS , , UINavigationBar. UINavigationController , , , UINavigationBar UIWindows, .

, , , , 64 .

, , , , [UIViewController viewDidLayoutSubviews], , .

, UINavigationBar , , UINavigationBar.

, , . , , , . , , , . x.

This is a terrible hack, so if someone comes up with a solution that will allow me to remove this code, share it.

0
source

All Articles