UIAnimation
UIViewAnimation 动画函数分析
@interface UIView(UIViewAnimation)
// 准备开始动画,animationID标识动画,context自定义消息
+ (void)beginAnimations:(NSString *)animationID context:(void *)context;
// 运行动画
+ (void)commitAnimations;
// 设置代理 default = nil
+ (void)setAnimationDelegate:(id)delegate;
// 将要开始动画时执行某些方法
+ (void)setAnimationWillStartSelector:(SEL)selector;
// 动画结束执行某些操作
+ (void)setAnimationDidStopSelector:(SEL)selector;
// default = 0.2 ,设置动画持续事件
+ (void)setAnimationDuration:(NSTimeInterval)duration;
// default = 0.0 , 设置动画开始时间
+ (void)setAnimationDelay:(NSTimeInterval)delay;
// default = now ([NSDate date]) , 设置动画开始日期
+ (void)setAnimationStartDate:(NSDate *)startDate;
// default = UIViewAnimationCurveEaseInOut 设置动画运动效果【注1】
+ (void)setAnimationCurve:(UIViewAnimationCurve)curve;
// default = 0.0. May be fractional 设置动画重复次数
+ (void)setAnimationRepeatCount:(float)repeatCount;
// default = NO. used if repeat count is non-zero
//动画自动重复,重复次数不能为0
+ (void)setAnimationRepeatAutoreverses:(BOOL)repeatAutoreverses;
// default = NO. If YES, the current view position is always used for new animations -- allowing animations to "pile up" on each other. Otherwise, the last end state is used for the animation (the default).
+ (void)setAnimationBeginsFromCurrentState:(BOOL)fromCurrentState;
// current limitation - only one per begin/commit
// 动画效果【注2】
+ (void)setAnimationTransition:(UIViewAnimationTransition)transition forView:(UIView *)view cache:(BOOL)cache;
// ignore any attribute changes while set.
+ (void)setAnimationsEnabled:(BOOL)enabled;
// 返回一个bool值,表示动画是否结束了
+ (BOOL)areAnimationsEnabled;
@end
UIViewAnimation block 动画
@interface UIView(UIViewAnimationWithBlocks)
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)

本文详细介绍了iOS中的UIViewAnimation,包括动画函数分析、block动画的使用,并列举了options参数的不同动画效果,如简单动画、block动画及block嵌套动画的示例。通过实例展示了如何创建和应用UIViewAnimation来实现视图的动态效果。
最低0.47元/天 解锁文章
7004

被折叠的 条评论
为什么被折叠?



