你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> iOS啟動頁倒計時跳過按鈕功能

iOS啟動頁倒計時跳過按鈕功能

編輯:IOS開發綜合

WSDrawCircleProgress, 根據UIBezierPath和CAShapeLayer自定義倒計時進度條,適用於app啟動的時候設置一個倒計時關閉啟動頁面。可以設置進度條顏色,填充顏色,進度條寬度以及點擊事件等。

Mou icon

公共方法:

//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]; 
} 

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved