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 

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

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

  • 相关阅读:
    git问题记录
    @Slf4j注解
    idea修改maven项目名
    spring的定时任务schedule
    @RequestParam详解
    统一全局异常处理将出错的栈信息打印到日志中
    python交互环境中导入文件中自定义的函数报错
    关于服务器的小技巧
    Python学习
    前后端分离时,获取不到session
  • 原文地址:https://www.cnblogs.com/hxwj/p/5320305.html
Copyright © 2011-2022 走看看