要做这个这样的效果:
自己写轮子也挺烦的,正好后面还要写曲线图什么的在网上找了个三方PNChart,pod继承进来包一下头文件#import 然后就可以用了,没什么好说的贴代码:
self.circleChart = [[PNCircleChart alloc] initWithFrame:CGRectMake(0,0,148,148)
total:@100current:@80clockwise:YES shadow:YES shadowColor:[UIColor lightGrayColor]];
self.circleChart.backgroundColor=[UIColor clearColor];
self.circleChart.displayAnimated= NO;//动画效果隐藏,一刷新就转挺烦的[self.circleChart setStrokeColor:[UIColor lightGrayColor]];
[self.circleChart setStrokeColorGradientStart:[UIColor colorWithRed:6/255.0green:149/255.0blue:157/255.0alpha:1]];
[self.circleChart strokeChart];
self.circleChart.countingLabel.hidden= YES;//把那个百分号给去掉,我还要写别的东西呢[self.circleView addSubview:self.circleChart];
背景透明了自己在view上面贴lable就好了,我是用xib拖得,懒。。