标签:
- (void)viewDidLoad {
[super viewDidLoad];
CAShapeLayer *shape = [CAShapeLayer layer];
UIBezierPath *bezierPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(100, 100, 200, 200) cornerRadius:98];
shape.path = bezierPath.CGPath;
shape.fillColor = [UIColor clearColor].CGColor;
shape.strokeColor = [UIColor blueColor].CGColor;
shape.lineWidth = 4.f;
shape.strokeStart = 0.f;
shape.strokeEnd = 0.7f;
[self.view.layer addSublayer:shape];
self.shape = shape;
}
- (IBAction)btn:(id)sender {
CGFloat text = (arc4random()%100)/100.f;
NSLog(@"====%f",text);
self.shape.strokeStart = text;
}
标签:
原文地址:http://www.cnblogs.com/oumygade/p/4455521.html