iOS 抖动动画
2016-01-23 15:14
483 查看
// 抖动动画
CABasicAnimation *shakeAnimation = [CABasicAnimation animationWithKeyPath:@”transform.translation.y”];
shakeAnimation.duration = 0.25f;
shakeAnimation.fromValue = [NSNumber numberWithFloat:-5];
shakeAnimation.toValue = [NSNumber numberWithFloat:5];
shakeAnimation.autoreverses = YES;
[_cLable.layer addAnimation:shakeAnimation forKey:nil];
// 放大动画
// [UIView animateWithDuration:0.25f animations:^{
// for (int i = 23; i > 20; i–) {
// _countLable.frame = CGRectMake(floatLable, 0, 23, 23);
// _countLable.layer.cornerRadius = i / 2;
// _countLable.font = FontSet(15);
// }
// } completion:^(BOOL finished) {
// _countLable.frame = CGRectMake(floatLable, 0, 20, 20);
// _countLable.font = FontSet(12);
// }];
CABasicAnimation *shakeAnimation = [CABasicAnimation animationWithKeyPath:@”transform.translation.y”];
shakeAnimation.duration = 0.25f;
shakeAnimation.fromValue = [NSNumber numberWithFloat:-5];
shakeAnimation.toValue = [NSNumber numberWithFloat:5];
shakeAnimation.autoreverses = YES;
[_cLable.layer addAnimation:shakeAnimation forKey:nil];
// 放大动画
// [UIView animateWithDuration:0.25f animations:^{
// for (int i = 23; i > 20; i–) {
// _countLable.frame = CGRectMake(floatLable, 0, 23, 23);
// _countLable.layer.cornerRadius = i / 2;
// _countLable.font = FontSet(15);
// }
// } completion:^(BOOL finished) {
// _countLable.frame = CGRectMake(floatLable, 0, 20, 20);
// _countLable.font = FontSet(12);
// }];
相关文章推荐
- iOS里Toll-Free Bridging的桥接机制
- IOS学习笔记1
- IOS Zbar SD二维码扫描的使用
- React-Native 开发 android & ios App,共享一份代码
- iOS个人整理14-界面间传值:属性传值---代理传值---block传值---单例传值
- React-Native 开发 android & ios App,共享一份代码
- IOS项目集成ShareSDK分享登录功能
- IOS开发:手势识别器
- iostat查看io使用率
- 【转】iOS设计模式之观察者模式
- 一个iOS应用内购买模块的开发
- iOS设备、Icon、LaunchImage、图片分辨率
- iOS 点击屏幕 回收键盘
- IOS异步获取数据并刷新界面dispatch_async的使用方法
- iOS loadView,viewDidLoad,viewDidUnload
- iOS开发实践之cell下载图片(SDWebImage)
- [转]iOS开发使用半透明模糊效果方法整理
- iOS二维码第三方库ZBar集成步骤
- iOS页面间跳转动画效果
- 系统管理 virtual box iostat ssh