zoukankan      html  css  js  c++  java
  • 转场动画再次学习

    demo链接:http://pan.baidu.com/s/1kVvn1Uf

    主要理清转场动画,和转场交互动画的使用

    present/dissmiss

    需要:

    self.transitioningDelegate = self;

    <UIViewControllerTransitioningDelegate>

    #pragma mark - 定制转场动画 (Present 与 Dismiss动画代理)
    - (id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented
                                                                      presentingController:(UIViewController *)presenting
                                                                          sourceController:(UIViewController *)source

    交互代理

    - (id<UIViewControllerInteractiveTransitioning>)interactionControllerForPresentation:(id<UIViewControllerAnimatedTransitioning>)animator

    push/pop

    需要

    <UINavigationControllerDelegate>

    self.navigationController.delegate = self;

    - (id <UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController
                                       animationControllerForOperation:(UINavigationControllerOperation)operation
                                                    fromViewController:(UIViewController *)fromVC
                                                      toViewController:(UIViewController *)toVC

    交互代理

    - (id <UIViewControllerInteractiveTransitioning>)navigationController:(UINavigationController *)navigationController
                              interactionControllerForAnimationController:(id <UIViewControllerAnimatedTransitioning>) animationController 

    然后你只需要在动画转场里面做动画就行了,添加手势百分比会根据动画的百分比播放动画

    简单来说自定义转场动画除了比较麻烦的步骤,剩下的就是--添加动画,控制手势方向和比率

  • 相关阅读:
    iou与giou对比
    Linux学习第一天 vim
    奖励加分申请
    人月神话阅读笔记3
    5.27
    5.26
    5.25
    5.23
    5.22
    5.21
  • 原文地址:https://www.cnblogs.com/hxwj/p/5320305.html
Copyright © 2011-2022 走看看