UINavigationBar custom transition animation

天涯浪子 提交于 2019-11-29 13:00:31

问题


I've created custom transitions between view controllers using the following protocols:

UIViewControllerAnimatedTransitioning and UIViewControllerTransitioningDelegate

Is it possible using the default UINavigationBar, to create custom transitions for the titles, right now they simply crossfade between view controllers, Or do i have to built my own navigation bar view from scratch?


回答1:


WWDC 2013 video #218 indicates that all custom transitions will crossfade the navigation bar, and that there's no way to customize this behavior.




回答2:


If your transition is both custom and interactive, then you can get some mileage out of UIViewControllerTransitionCoordinator.
see Here.

For example, in viewWillAppear of the view controller that is the "To" (target) vc:

[[self transitionCoordinator] animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {

    // mess around with stuff here

} completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {

    // all done now
}];


来源:https://stackoverflow.com/questions/21613682/uinavigationbar-custom-transition-animation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!