之四:CATransition - 转场动画

关键属性:

  • type 过渡效果 
  1. kCATransitionFade  淡出
  2. kCATransitionMoveIn  覆盖原图
  3. kCATransitionPush  推出
  4. kCATransitionReveal  底部显出来
  • subtype 过渡方向
  1. kCATransitionFromRight;
  2. kCATransitionFromLeft  默认值
  3. kCATransitionFromTop;
  4. kCATransitionFromBottom

代码演示1:不用setSubtype,只用setType

 animation.type=@"pageCurl";  
  1. pageCurl   向上翻一页
  2. pageUnCurl   向下翻一页
  3. rippleEffect   滴水效果
  4. suckEffect   收缩效果,如一块布被抽走
  5. cube   立方体效果
  6. oglFlip   上下翻转效果

代码演示2:setType与setSubtype组合

 CATransition *animation = [CATransition animation];

 animation.delegate = self;

 animation.duration = 1.0f;

 animation.timingFunction = UIViewAnimationCurveEaseInOut;

 animation.type = kCATransitionMoveIn;

 animation.subtype = kCATransitionFromTop;

 [_myView.layer addAnimation:animation forKey:@"myTransition"];
上一篇:原创)CentOS6.4下安装xampp(一定要在linux上下载)


下一篇:web开发工具类