您的位置:首页 > 移动开发 > IOS开发

iOS中的动画-简单介绍

2016-01-15 12:47 253 查看
iOS中有两种动画方式

第一种:头尾式

[UIView beginAnimations:nil context:nil];
//设置动画持续时间
[UIView setAnimationDuration:2.0];
//动画执行完毕后,调用removeCover方法 (代理模式)
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(removeCover)];

//要执行动画的代码

//提交动画
[UIView commitAnimations];


第二种

[UIView animateWithDuration:0.25 animations:^{

//存放需要执行动画的代码

} completion:^(BOOL finished){

// 动画之行完毕后会自动调用这个block内部的代码

}];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: