我们定义一个UIView属性view4animation来执行动画:
1. UIView动画块
//标识着动画的开始
[UIView beginAnimations:@"btn4kuai" context:nil];
//这里面写动画的内容
//动画持续时间
[UIView setAnimationDuration:1];
//改变颜色
self.view4animation.backgroundColor = [UIColor blueColor];
CGPoint center = self.view4animation.center;
center.x += 100;
center.y += 120;
//改变中心点
self.view4animation.center = center;
//改变透明度
self.view4animation.alpha = 1;
//动画结束时执行事件
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(changeBtn:)];
//提交动画,也就是动画结束了
[UIView commitAnimations];
- (void)changeBtn:(NSString *)str{
NSLog(@"view动画执行完毕");
[UIView beginAnimations:@