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 

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

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

  • 相关阅读:
    hdu2243之AC自动机+矩阵乘法
    jstl
    HDU 3360 National Treasures 奇偶匹配的最低点覆盖
    【UVA】11992
    what is the difference between definition and declaration in c
    UVALive 6485 Electric Car Rally (BFS,PQ)
    Android发展_备份短信
    vxWorks 命令
    【C++智能指针 auto_ptr】
    Get and Post(Unity3D六个发展)
  • 原文地址:https://www.cnblogs.com/hxwj/p/5320305.html
Copyright © 2011-2022 走看看