zoukankan      html  css  js  c++  java
  • CATransition 转场动画

       

    subtype 转场动画 动画效果的方向

     type 转场动画的 动画效果

     kCATransitionFade   交叉淡化过渡

     kCATransitionMoveIn 新视图移到旧视图上面

     kCATransitionPush   新视图把旧视图推出去

     kCATransitionReveal 将旧视图移开,显示下面的新视图

     私有api 不建议使用 苹果不提供维护 并且有可能app审核不通过

     pageCurl            向上翻一页

     pageUnCurl          向下翻一页

     rippleEffect        滴水效果

     suckEffect          收缩效果 如一块布被抽走

     cube                立方体效果

     oglFlip             上下翻转效果

    初始化: CATransition *trans = [CATransition animation];

    选择动画效果:trans.type =@"oglFlip" (私有API动画效果需要写成字符串@“”)

    系统给的方法不需要:trans.type = kCATransitionPush

    设置动画的持续时间: trans.duration = 2;

     把动画添加到图片上:   [image.layer addAnimation:trans forKey:@"tran"];

    二. 导航控制器的动画组

     nextViewController *next = [[nextViewController alloc]init];

            CATransition *animation = [CATransition animation];

            animation.type = @"suckEffect";

            animation.subtype = kCATransitionFromLeft;

            animation.duration = 1;

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

    //        如果使用自定义的转场动画,必须禁用系统给的动画

            [self.navigationController pushViewController:next animated:NO];

  • 相关阅读:
    MemCached总结二:数据管理指令
    MemCached总结一:Unbutu操作系统下memcached服务器安装和telnet方式连接memcache
    Laravel5 开启Debug
    状压dp
    树形dp
    区间dp
    线性dp
    背包九讲
    dp求解各种子串子序列
    线段树详解
  • 原文地址:https://www.cnblogs.com/popper123/p/4849144.html
Copyright © 2011-2022 走看看