使用首尾式动画
大概有以下 API:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2];
self.iconBtn.bounds = bounds;
[UIView commitAnimations];
//[UIView setAnimationDuration:5.0];//设置持续时长
//[UIView setAnimationDelay:1.0];//设置延迟
// [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];//设置动画块中的动画属性变化的曲线
/*
typedef NS_ENUM(NSInteger, UIViewAnimationCurve) {
UIViewAnimationCurveEaseInOut, // slow at beginning and end
UIViewAnimationCurveEaseIn, // slow at beginning
UIViewAnimationCurveEaseOut, // slow at end
UIViewAnimationCurveLinear
};
*/
//[UIView setAnimationRepeatAutoreverses:NO];//是否回复
//[UIView setAnimationRepeatCount:10];//重复次数
//[UIView setAnimationStartDate:(NSDate *)];//设置动画开始运行的时间
//[UIView setAnimationDelegate:self];//设置代理
//[UIView setAnimationWillStartSelector:(SEL)];//设置动画开始运动的执行方法
//[UIView setAnimationDidStopSelector:(SEL)];//设置动画运行结束后的执行方法
还有一些高级动画,可以实现动画 翻转、旋转,偏移,翻页,缩放,取反的动画效果,后续!