当前位置: 移动技术网 > 移动技术>移动开发>IOS > iOS启动页倒计时跳过按钮功能

iOS启动页倒计时跳过按钮功能

2019年07月24日  | 移动技术网移动技术  | 我要评论

wsdrawcircleprogress, 根据uibezierpath和cashapelayer自定义倒计时进度条,适用于app启动的时候设置一个倒计时关闭启动页面。可以设置进度条颜色,填充颜色,进度条宽度以及点击事件等。

mou icon

公共方法:

//set track color 
@property (nonatomic,strong)uicolor *trackcolor; 
//set progress color 
@property (nonatomic,strong)uicolor *progresscolor; 
//set track background color 
@property (nonatomic,strong)uicolor *fillcolor; 
//set progress line width 
@property (nonatomic,assign)cgfloat linewidth; 
//set progress duration 
@property (nonatomic,assign)cgfloat animationduration; 
/** 
 * set complete callback 
 * 
 * @param linewidth line width 
 * @param block  block 
 * @param duration time 
 */ 
- (void)startanimationduration:(cgfloat)duration withblock:(drawcircleprogressblock )block; 

使用:

- (void)viewdidload { 
 [super viewdidload]; 
 [self.view addsubview:self.imageview]; 
 drawcircleprogressbutton *drawcircleview = [[drawcircleprogressbutton alloc]initwithframe:cgrectmake(self.view.frame.size.width - 55, 30, 40, 40)]; 
 drawcircleview.linewidth = 2; 
 [drawcircleview settitle:@"跳过" forstate:uicontrolstatenormal]; 
 [drawcircleview settitlecolor:[uicolor whitecolor] forstate:uicontrolstatenormal]; 
 drawcircleview.titlelabel.font = [uifont systemfontofsize:14]; 
 [drawcircleview addtarget:self action:@selector(removeprogress) forcontrolevents:uicontroleventtouchupinside]; 
 /** 
  * progress 完成时候的回调 
  */ 
 __weak viewcontroller *weakself = self; 
 [drawcircleview startanimationduration:5 withblock:^{ 
  [weakself removeprogress]; 
 }]; 
 [self.view addsubview:drawcircleview]; 
} 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网