标签:
这里主要用到了ios4.0以后 UIView的类方法 animateWithDuration:
函数原型包括以下类方法
+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations + (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion + (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion
参数介绍
duration:动画的持续时间
annimations:动画的实体
completion:annimations执行完后立即执行的代码
options:枚举值,动画执行期间的一些设置
下面是可以设置动画效果的属性:
动画效果的代码块可以有多个属性
[UIView animateWithDuration:0.5 animations:^{ view.alpha = 0; view.frame = CGRectMake(0, 0, 100, 100); }];
标签:
原文地址:http://www.cnblogs.com/ieso-ios/p/5161085.html