IOS hollow circle download progress indicator control, ios hollow progress indicator
Self. layer = [CAShapeLayer layer]; self. layer. frame = CGRectMake (0, 0,100,100); self. layer. position = self. view. center; self. layer. lineWidth = 10.0; self. layer. fillColor = [UIColor clearColor]. CGColor; self. layer. strokeColor = [UIColor lightGrayColor]. CGColor; self. layer. lineCap = kCALineCapSquare;/* CA_EXTERN NSString * const partition _ partition (_ MAC_10_6, _ IPHONE_3_0); CA_EXTERN NSString * const kCALineCapRound _ partition (_ MAC_10_6, _ IPHONE_3_0); CA_EXTERN NSString * const kCALineCapSquare */UIBezierPath * path = [UIBezierPath bezierPathWithOvalInRect: CGRectMake (0, 0,100,100)]; self. layer. path = path. CGPath; [self. view. layer addSublayer: self. layer]; self. layer. strokeEnd = 0.0; _ progress = 0; self. timer = [NSTimer scheduledTimerWithTimeInterval: 0.1 target: self selector: @ selector (updateProgress) userInfo: nil repeats: YES]; // update download progress _ progress + = 0.01; if (self. layer. strokeEnd> = 1) {self. timer. fireDate = [NSDate distantFuture];} else {self. layer. strokeEnd = _ progress ;}