定义动画效果覆盖的代码区域,然后设置一个动画时间,即可。
代码实践中会经常遇到,多写几遍就熟悉了。
//开始动画 [UIView beginAnimations:nil context:nil]; //默认是1/4s,需要double类型数据 [UIView setAnimationDuration:2.0]; //提交动画,动画结束 [UIView commitAnimations];
定义动画效果覆盖的代码区域,然后设置一个动画时间,即可。
代码实践中会经常遇到,多写几遍就熟悉了。
//开始动画 [UIView beginAnimations:nil context:nil]; //默认是1/4s,需要double类型数据 [UIView setAnimationDuration:2.0]; //提交动画,动画结束 [UIView commitAnimations];