两种动画:
1:UIView动画
UIView的部分属性支持动画:
frame, bounds(中心点不变,放大或缩小), center, transform, alpha
[UIView beginAnimation: context:];
[UIView setAnimationTransition:UIVIewAnimationTransitionFlikpFromLeft forView:self.view ]
layer
setClipsToBounds把超出部分切掉
[UIView commitAnimation];
UIView支持翻转以及翻页效果
UIView setAnimationWillStartSelector:(SEL)
矩阵:
2:CAlayer动画
[imageView.layer addAnimation:animation forKey:@" "];
CAKeyFrameAnimation
3:CoreAnimation动画,里面封装了iOS全部的动画效果
CATransition type subType
也是addLayer上面
===============================================================
1:UIView动画
UIView的属性frame, bounds(中心点不变,放大或缩小), center, transform, alpha支持动画
[UIView beginAnimations:@"animationID"context:nil];
[UIView setAnimationDuration:0.5f];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationRepeatAutoreverses:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDownforView:self.viewcache:YES];
[UIViewcommitAnimations];
2:layer动画
CATransition *animation = [CATransitionanimation];
animation.delegate = self;
animation.duration = 0.5f * slider.value;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.fillMode = kCAFillModeForwards;
animation.endProgress = slider.value;
animation.removedOnCompletion = NO;
case 0:
animation.type = @"cube";//---
break;
case 1:
animation.type = @"suckEffect";//103
break;
case 2:
animation.type = @"oglFlip";//When subType is "fromLeft" or "fromRight", it's the official one.
break;
case 3:
animation.type = @"rippleEffect";//110
break;
case 4:
animation.type = @"pageCurl";//101
break;
case 5:
animation.type = @"pageUnCurl";//102
break;
case 6:
animation.type = @"cameraIrisHollowOpen ";//107
break;
case 7:
animation.type = @"cameraIrisHollowClose ";//106
break;
default:
break;
animation.subtype = kCATransitionFromRight;
[self.view.layeraddAnimation:animation forKey:@"animation"];