问题
I've got a custom segue that uses the UIViewAnimationOptionTransitionFlipFromLeft to transition between views.
When the new view comes on screen, there is a brief but discernible 'blink' caused by the Navigation Bar elements jumping from a left-aligned state to their appropriate positions. Following is a screenshot captured near the very end of the transition:

You can see that the title and two bar button items are left aligned; completely out of place from where they will eventually rest.
Following is a screenshot captured after the transition has completed:

Here the buttons and title are positioned correctly. During the instant between the first and second images, the icons blink into position.
The view is setup in storyboard. The view is not part of a UINavigationController hierarchy, so the navigation bar and its items are manually created on the view via the attributes inspector, 'Simulated Metrics' -> 'Top Bar: Translucent Navigation Bar'.
How can I force the navigation bar items to be correctly positioned when they first appear during the transition?
Thank you in advance! :)
回答1:
Got it! I found that using the [UIView performWithoutAnimation:^{}] block inside of transitionWithView solved this problem:
[UIView transitionWithView:src.navigationController.view duration:0.2
options:UIViewAnimationOptionTransitionFlipFromLeft
animations:^{
[UIView performWithoutAnimation:^{
[navController setViewControllers:[NSArray arrayWithObject:dst] animated:NO];
}];
}
completion:nil];
来源:https://stackoverflow.com/questions/26127915/during-custom-segue-transition-views-navigation-bar-items-are-misplaced