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

UI 动画之UIView动画的 四种 使用含有block的类方法 实现动画

2015-10-06 20:06 381 查看
#pragma mark 使用
含有block的类方法

//第一种:

[UILabel
animateWithDuration:2
animations:^{

//动画执行的方式。-旋转,平移,缩放等。

}];

//第二种

[UILabel
animateWithDuration:2
animations:^{

//书写动画效果。

_customLabel.alpha =
0.9;

}
completion:^(BOOL finished) {

//动画完成后执行的代码。

_customLabel.transform =
CGAffineTransformRotate(_customLabel.transform,
12);

}];

//第三种:

[UILabel
animateWithDuration:2
delay:0
options:UIViewAnimationOptionLayoutSubviews
animations:^{

//书写动画效果
}
completion:^(BOOL finished) {

//动画完成后执行的代码。
}];

//第四种:

[UILabel
animateWithDuration:2
delay:0
usingSpringWithDamping:2
initialSpringVelocity:1
options:UIViewAnimationOptionAllowAnimatedContent
animations:^{

//书写动画效果。
}
completion:^(BOOL finished) {

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