您的位置:首页 > 产品设计 > UI/UE

UIView 自带动画

2016-03-04 00:00 435 查看
第一种方式

[UIView beginAnimations:nil context:nil];
//设置动画时间
[UIView setAnimationDuration:1];
view.backgroundColor = [UIColor cyanColor];
[UIView commitAnimations];

第二种方式

[UIView animateWithDuration:1 animations:^{
//在这个代码内,写动画效果
view.transform = CGAffineTransformMakeRotation(M_PI_2);
}];

第三种方式

[UIView animateWithDuration:2 animations:^{
view.transform = CGAffineTransformMakeScale(1,1);
} completion:^(BOOL finished) {
//当动画执行结束的时候,执行这个代码块
NSLog(@"动画结束了,调用了这个代码块");
}];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: