离散进度图层绘制以及点击
2016-09-07 本文已影响26人
逗你玩之豆豆豆
用到知识:
1、贝塞尔曲线
2、绘图
用法
CGFloat width = [UIScreenmainScreen].bounds.size.width;
XQCircleView *circle = [[XQCircleView alloc] initWithFrame:CGRectMake(20, 100, width - 40, width - 40)];
circle.dataArray = @[@0.2,@0.2,@0.1,@0.3,@0.2];
circle.circleWidth = 40.0f;
circle.progress = 0.1;
circle.mainColor = [UIColor greenColor];
circle.secondaryColor = [UIColorlightGrayColor];
circle.selectedNum = ^(NSInteger number){
self.clickLabel.text = [NSStringstringWithFormat:@"点击了%ld个分块",number];
};
GitHub:https://github.com/maxiaoqiang/ProgressCircle