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

2025-05-29 0 75

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

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

公共方法:

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18
//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;

使用:

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18
- (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];

}

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

快网idc优惠网 建站教程 iOS启动页倒计时跳过按钮功能 https://www.kuaiidc.com/90637.html

相关文章

发表评论
暂无评论