Skip to content

huisedediao/XBCircleProgressView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

XBCircleProgressView

圆圈倒计时的动画效果
支持设置方向、设置进度(带先快后慢动画)、支持设置前景色、后景色

效果图:

image

示例代码:


  • (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib.

    XBCircleProgressView *circleView = [XBCircleProgressView new]; [self.view addSubview:circleView]; _circleView = circleView; circleView.delegate = self; circleView.direction = XBCircleProgressViewDirection_anticlockwise; circleView.frame = CGRectMake(100, 100, 200, 200); circleView.waitTime = 10; circleView.circleBorderWidth = 5; // circleView.backgroundColor = [UIColor grayColor]; // circleView.foregroundColor = [UIColor redColor]; // [circleView setProgress:0.5 animation:YES]; // [circleView startAnimation]; }

  • (IBAction)changeProgress:(id)sender { [_circleView setProgress:0.2 animation:YES]; }

  • (IBAction)reset:(id)sender { [_circleView setProgress:0 animation:YES]; }

  • (void)circleProgressViewDidSettedProgress:(XBCircleProgressView *)progressView { [_circleView startAnimation]; }

  • (void)circleProgressViewOnTheEnd:(XBCircleProgressView *)progressView { // [progressView removeFromSuperview]; // _circleView = nil; }

  • (id)circleProgressView:(XBCircleProgressView *)progressView titleForSeconds:(int)seconds totalSeconds:(int)totalSeconds { return [NSString stringWithFormat:@"%d",seconds]; }

@end

About

很细腻的圆圈倒计时的动画

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published