如何为导航控制器提供自定义 UIViewControllerAnimatedTransitioning 并使用默认 UIViewControllerInteractiveTransitioning
Posted
技术标签:
【中文标题】如何为导航控制器提供自定义 UIViewControllerAnimatedTransitioning 并使用默认 UIViewControllerInteractiveTransitioning【英文标题】:How to provide custom UIViewControllerAnimatedTransitioning and use default UIViewControllerInteractiveTransitioning for a navigation controller 【发布时间】:2018-07-13 07:56:06 【问题描述】:如何为导航控制器提供自定义UIViewControllerAnimatedTransitioning
并使用默认UIViewControllerInteractiveTransitioning
#pragma mark UINavigationControllerDelegate
- (id <UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController
animationControllerForOperation:(UINavigationControllerOperation)operation
fromViewController:(UIViewController *)fromVC
toViewController:(UIViewController *)toVC
// Return custom transitioner
-(id<UIViewControllerInteractiveTransitioning>)navigationController:(UINavigationController *)navigationController interactionControllerForAnimationController:(id<UIViewControllerAnimatedTransitioning>)animationController
return nil; // Use the deafult UIViewControllerInteractiveTransitioning here
【问题讨论】:
【参考方案1】:可能有一些老套的方法,但不是干净的方法。
【讨论】:
以上是关于如何为导航控制器提供自定义 UIViewControllerAnimatedTransitioning 并使用默认 UIViewControllerInteractiveTransitioning的主要内容,如果未能解决你的问题,请参考以下文章
如何为 NavigationView 中的单个菜单项提供自定义图标颜色?