iOS动画 对号和叉叉
2017-05-19 11:20
176 查看
一个很好玩的动画,分享给大家:
很方便的调用方法:
SHCheckInfoView头文件接口:
代码GitHub地址:https://github.com/lvshaohua/SHCheckInfoView
很方便的调用方法:
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.checkView = [[SHCheckInfoView alloc] initWithFrame:CGRectMake(0, 0, 40, 40) lineWidth:2 lineColor:[UIColor redColor]]; self.checkView.center = self.view.center; [self.view addSubview:self.checkView]; } - (IBAction)onRightBtnAction:(id)sender { [self.checkView showAnimationWithState:XYProgressResult_Success duration:1.5 complete:nil]; } - (IBAction)onFailedBtnAction:(id)sender { [self.checkView showAnimationWithState:XYProgressResult_Failed duration:1.5 complete:nil]; }
SHCheckInfoView头文件接口:
#import <UIKit/UIKit.h> // 设置动画效果样式 typedef enum{ XYProgressResult_Success, XYProgressResult_Failed, }XYProgressResultState; @interface SHCheckInfoView : UIView // 线条宽度,默认为3.0; @property (nonatomic, assign) CGFloat lineWidth; // 线条颜色,默认是redColor @property (nonatomic, strong) UIColor *lineColor; // 设置填充颜色,默认是clearColor; @property (nonatomic, strong) UIColor *fillColor; - (instancetype)initWithFrame:(CGRect)frame lineWidth:(CGFloat)lineWidth lineColor:(UIColor *)lineColor; /* * state 成功或者失败状态,决定绘画样式。 * duration 动画时长。 * complate 动画结束时回调。 */ - (void)showAnimationWithState:(XYProgressResultState)state duration:(NSTimeInterval)duration complete:(void (^) (BOOL isFinish))complate; @end
代码GitHub地址:https://github.com/lvshaohua/SHCheckInfoView
相关文章推荐
- iOS动画 对号和叉叉
- iOS动画 对号和叉叉
- iOS动画 对号和叉叉
- iOS动画 对号和叉叉
- iOS动画 对号和叉叉
- iOS动画 对号和叉叉
- iOS动画 对号和叉叉
- iOS动画 对号和叉叉
- iOS动画 对号和叉叉
- iOS动画 对号和叉叉
- iOS动画 对号和叉叉
- iOS动画 对号和叉叉
- iOS动画 对号和叉叉
- iOS动画 对号和叉叉
- ios view与view间切换的动画效果
- 【iOS-Cocos2d游戏开发之二十一 】自定义精灵类并为你的精灵设置攻击帧以及动画创建!【二】 推荐
- iOS-实现简单的动画效果
- 【iOS-Cocos2d游戏开发之二十二 】CCSpeed实现CCAnimate动画进行时设置慢动作以及设置游戏加减速进行(塔防游戏必备)! .
- iOS动画:Core Animation概述
- iOS的动画效果类型及实现方法