这篇文章主要介绍了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启动页倒计时跳过按钮功能
基础教程推荐
猜你喜欢
- Android中的webview监听每次URL变化实例 2023-01-23
- Android开发使用RecyclerView添加点击事件实例详解 2023-06-15
- iOS开发教程之XLForm的基本使用方法 2023-05-01
- Flutter绘图组件之CustomPaint使用详解 2023-05-12
- IOS 播放系统提示音使用总结(AudioToolbox) 2023-03-01
- IOS应用内跳转系统设置相关界面的方法 2022-11-20
- Flutter手势密码的实现示例(附demo) 2023-04-11
- 解决Android Studio突然不显示logcat日志的问题 2023-02-04
- Android多返回栈技术 2023-04-15
- android studio按钮监听的5种方法实例详解 2023-01-12
