zoukankan      html  css  js  c++  java
  • iOS之push present 动画

    直接源码:

    - (void) transitionWithType:(NSString *) type WithSubtype:(NSString *) subtype ForView : (UIView *) view

    {

        //创建CATransition对象

        CATransition *animation = [CATransition animation];

        

        //设置运动时间

        animation.duration = 0.7f;

        

        //设置运动type

        animation.type = type;

        if (subtype != nil) {

            

            //设置子类

            animation.subtype = subtype;

        }

        

        //设置运动速度

        animation.timingFunction = UIViewAnimationOptionCurveEaseInOut;

        

        [view.layer addAnimation:animation forKey:@"animation"];

    }

     

    把此方法粘贴后。就可以 思考你要啥 动画了

     

    typedef enum : NSUInteger {

        Fade = 1,                   //淡入淡出

        Push,                       //推挤

        Reveal,                     //揭开

        MoveIn,                     //覆盖

        Cube,                       //立方体

        SuckEffect,                 //吮吸

        OglFlip,                    //翻转

        RippleEffect,               //波纹

        PageCurl,                   //翻页

        PageUnCurl,                 //反翻页

        CameraIrisHollowOpen,       //开镜头

        CameraIrisHollowClose,      //关镜头

        CurlDown,                   //下翻页

        CurlUp,                     //上翻页

        FlipFromLeft,               //左翻转

        FlipFromRight,              //右翻转

        

    } AnimationType;

     

    如果是在父类写的此方法。子类直接调用。

     [super transitionWithType:@"cude" WithSubtype:kCATransitionFromLeft ForView:self.navigationController.view];要啥 效果可以 自己尝试。Fight.

  • 相关阅读:
    linux 网络性能优化
    select/poll/epoll原理探究及总结
    linux socket读数据错误解释
    linux 单机跨进程通信
    map与hash_map使用与对比
    python web自动化测试框架搭建(功能&接口)——环境搭建
    Jenkins构建触发器的区别
    python改变导入模块中的变量的问题
    Jmeter断言中判断请求失败的响应代码问题
    Jmeter中动态获取jsessionid来登录
  • 原文地址:https://www.cnblogs.com/XHShare/p/4934350.html
Copyright © 2011-2022 走看看