这篇文章主要介绍了iOS启动页倒计时跳过按钮功能,需要的朋友可以参考下
WSDrawCircleProgress, 根据UIBezierPath和CAShapeLayer自定义倒计时进度条,适用于app启动的时候设置一个倒计时关闭启动页面。可以设置进度条颜色,填充颜色,进度条宽度以及点击事件等。
公共方法:
//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];
}
沃梦达教程
本文标题为:iOS启动页倒计时跳过按钮功能
猜你喜欢
- 最好用的ios数据恢复软件:PhoneRescue for Mac 2023-09-14
- Android实现监听音量的变化 2023-03-30
- iOS 对当前webView进行截屏的方法 2023-03-01
- Android MaterialButton使用实例详解(告别shape、selector) 2023-06-16
- 详解flutter engine 那些没被释放的东西 2022-12-04
- Android实现轮询的三种方式 2023-02-17
- 作为iOS开发,这道面试题你能答出来,说明你基础很OK! 2023-09-14
- Android studio实现动态背景页面 2023-05-23
- Flutter实现底部和顶部导航栏 2022-08-31
- SurfaceView播放视频发送弹幕并实现滚动歌词 2023-01-02
