美文网首页
PPFMultiplePercentCircleView

PPFMultiplePercentCircleView

作者: 轻云绿原 | 来源:发表于2020-04-22 10:26 被阅读0次

PPFMultiplePercentCircleView

效果

multiple percent circles

引用

GitHub

pod 'PPFMultiplePercentCircleView'

怎么用

initialize

1.initialize circles that are displayed in PPFMultiplePercentCircleView

        let list = [
            PPFMultiplePercentCircleView.Circle(lineForegroundColor: randomColor(), lineBackgroundColor: randomColor(), lineWidth: 10, linePercent: 0.30),
            PPFMultiplePercentCircleView.Circle(lineForegroundColor: randomColor(), lineBackgroundColor: randomColor(), lineWidth: 10, linePercent: 0.10),
            PPFMultiplePercentCircleView.Circle(lineForegroundColor: randomColor(), lineBackgroundColor: randomColor(), lineWidth: 10, linePercent: 0.08),
            PPFMultiplePercentCircleView.Circle(lineForegroundColor: randomColor(), lineBackgroundColor: randomColor(), lineWidth: 10, linePercent: 1),
            PPFMultiplePercentCircleView.Circle(lineForegroundColor: randomColor(), lineBackgroundColor: randomColor(), lineWidth: 10, linePercent: 0.30),
            PPFMultiplePercentCircleView.Circle(lineForegroundColor: randomColor(), lineBackgroundColor: randomColor(), lineWidth: 10, linePercent: 0.50),
            PPFMultiplePercentCircleView.Circle(lineForegroundColor: randomColor(), lineBackgroundColor: randomColor(), lineWidth: 10, linePercent: 0.78),
            PPFMultiplePercentCircleView.Circle(lineForegroundColor: randomColor(), lineBackgroundColor: randomColor(), lineWidth: 10, linePercent: 0),
        ]

2.initialize

        let v = PPFMultiplePercentCircleView(circles: [], holeRadius: 20, lineSpace: 1)
        v.backgroundColor = UIColor.white
        v.clipsToBounds = true
        v.frame = CGRect(x: view.bounds.width / 2 - 150, y: 100, width: 300, height: 300)
        view.addSubview(v)
        v.set(circles: list, animate: false)
        self.v = v

reset circles

v.set(circles: list, animate: true,duration:2)

remove circle

v.removeCircleAt(index:6, animate: true)

append circle

v.append(circle: circle, animate: true)

相关文章

网友评论

      本文标题:PPFMultiplePercentCircleView

      本文链接:https://www.haomeiwen.com/subject/ceubihtx.html