由於新項目的的需求,需要畫環形圖,由於以前都沒接觸過這一類(我是菜鳥),去cocochina山找到了一個案例,個人覺得還可以,分享一下
github 地址https://github.com/zhouxing5311/ZZCircleProgress
這個使用起來非常的簡單
作者開放了很多接口,可以根據自己的需求進行更改
一般就是聲明一個累類就Ok了
具體實現的代碼如下
可能我的代碼有點不一樣,我自己加入了一些元素進去
//無小圓點、同動畫時間
self.zzCircleProgress = [[ZZCircleProgress alloc] initWithFrame:CGRectMake((JdryScreeWidth*0.75)+9, 16, 50, 50) pathBackColor:BACK_COLOR pathFillColor:BLUE_COLOR startAngle:270 strokeWidth:4];
self.zzCircleProgress.showPoint = NO;
self.zzCircleProgress.notAnimated = YES;
self.zzCircleProgress.progress = 0.9;
self.zzCircleProgress.fontSize = 16.0;
// self.zzCircleProgress.animationModel = CircleIncreaseByProgress;
self.zzCircleProgress.textColor = BLUE_COLOR;
self.zzCircleProgress.labelStr = [NSString stringWithFormat:@"%d%%", (int)(self.zzCircleProgress.progress *100)];
[self addSubview:self.zzCircleProgress];
【iOS 畫環形圖】的相關資料介紹到這裡,希望對您有所幫助! 提示:不會對讀者因本文所帶來的任何損失負責。如果您支持就請把本站添加至收藏夾哦!