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) {
//动画完成后执行的代码。
}];
含有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) {
//动画完成后执行的代码。
}];
相关文章推荐
- UI 动画之反射变换的旋转
- TrueType字体的后缀名解释
- TrueType字体的后缀名解释
- TrueType字体的后缀名解释
- UI 动画之反射变换的缩放
- 使用UGUI实现拖拽功能(拼图小游戏)
- iOS UITableview 只刷新一个cell 或 section
- UI14_图片相关
- UI 动画之UIView动画之间的一些方法
- UISearchBar
- WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
- UI 动画之反射变换的平移
- UIsearchBar
- SpriteBuilder中本地化的局限性
- SpriteBuilder中本地化的局限性
- SpriteBuilder中本地化的局限性
- UI13_Block传值练习
- UI13_Block
- 两个Arduino之间进行串口通信出错的原因
- android UI界面设计(2)