WSDrawCircleProgress, 根據(jù)UIBezierPath和CAShapeLayer自定義倒計(jì)時(shí)進(jìn)度條,適用于app啟動(dòng)的時(shí)候設(shè)置一個(gè)倒計(jì)時(shí)關(guān)閉ios/190721.html">啟動(dòng)頁面。可以設(shè)置進(jìn)度條顏色,填充顏色,進(jìn)度條寬度以及點(diǎn)擊事件等。

公共方法:
//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 完成時(shí)候的回調(diào) */ __weak ViewController *weakSelf = self; [drawCircleView startAnimationDuration:5 withBlock:^{ [weakSelf removeProgress]; }]; [self.view addSubview:drawCircleView]; }
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注