溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

iOS啟動頁倒計(jì)時跳過按鈕功能

發(fā)布時間:2020-09-15 18:26:17 來源:腳本之家 閱讀:167 作者:-此夜微涼 欄目:移動開發(fā)

WSDrawCircleProgress, 根據(jù)UIBezierPath和CAShapeLayer自定義倒計(jì)時進(jìn)度條,適用于app啟動的時候設(shè)置一個倒計(jì)時關(guān)閉啟動頁面??梢栽O(shè)置進(jìn)度條顏色,填充顏色,進(jìn)度條寬度以及點(diǎn)擊事件等。

iOS啟動頁倒計(jì)時跳過按鈕功能

公共方法:

//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 完成時候的回調(diào) 
  */ 
 __weak ViewController *weakSelf = self; 
 [drawCircleView startAnimationDuration:5 withBlock:^{ 
  [weakSelf removeProgress]; 
 }]; 
 [self.view addSubview:drawCircleView]; 
} 

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI