UIView延迟效果做出动画/UIView动画块
2016-03-14 00:00
183 查看
摘要: UIView延迟效果做出动画/UIView动画块
// 在规定时间 慢慢完成操作
[UIView animateWithDuration:1 animations:^{
self.button.backgroundColor = [UIColor orangeColor];
} completion:^(BOOL finished) {
// 完成回调后 还原来颜色
[UIView animateWithDuration:1 animations:^{
self.button.backgroundColor = [UIColor clearColor];
}];
}];
Demo下载演示
如果需要重复多次推荐这种方法
/**
animateWithDuration 多少时间完成动画
delay 延迟多久开始做动画
*/
[UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionAutoreverse animations:^{
// 动画重复次数
[UIView setAnimationRepeatCount:3];
self.button.backgroundColor = [UIColor purpleColor];
} completion:^(BOOL finished) {
// 完成回调后 还原颜色
[UIView animateWithDuration:1 animations:^{
self.button.backgroundColor = [UIColor clearColor];
}];
}];
点击下载演示
// 在规定时间 慢慢完成操作
[UIView animateWithDuration:1 animations:^{
self.button.backgroundColor = [UIColor orangeColor];
} completion:^(BOOL finished) {
// 完成回调后 还原来颜色
[UIView animateWithDuration:1 animations:^{
self.button.backgroundColor = [UIColor clearColor];
}];
}];
Demo下载演示
如果需要重复多次推荐这种方法
/**
animateWithDuration 多少时间完成动画
delay 延迟多久开始做动画
*/
[UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionAutoreverse animations:^{
// 动画重复次数
[UIView setAnimationRepeatCount:3];
self.button.backgroundColor = [UIColor purpleColor];
} completion:^(BOOL finished) {
// 完成回调后 还原颜色
[UIView animateWithDuration:1 animations:^{
self.button.backgroundColor = [UIColor clearColor];
}];
}];
点击下载演示
相关文章推荐
- UIViewTranstion动画
- 拼图pintuer去掉响应式的方法
- AMQP――Advanced Message Queuing Protocol(高级消息队列协议)小结
- 用户界面(人机界面)
- 使用RequestBuilder与服务器通讯
- BEA-290074 <Deployment service servlet received file download request for file "security/SerializedSystemIni.dat". The file may exist, but download of this file is not allowed.>
- jsp之request对象
- UI自定义进度条控件
- CALayer和UIView的区别
- WWDC15 Session笔记 - Xcode 7 UI 测试初窥
- Android UI系列-----ImageView的scaleType属性
- POJ 1986 Distance Queries(离线tarjan-LCA)
- javaUI 使用举例
- java UI db.properties
- 如何判断我的电脑是否为通过UEFI模式启动
- EasyUI DataGrid 编辑单元格
- EasyUI DataGrid 编辑单元格
- EasyUI DataGrid 编辑单元格
- iOS开发UI篇—核心动画(UIView封装动画)
- 27.UITableView初探