Git Product home page Git Product logo

xlcircleprogress's Introduction

XLCircleProgress

利用贝塞尔曲线实现的圆环进度指示器

显示效果如下

使用方法

创建方法:

_circle = [[XLCircleProgress alloc] initWithFrame:CGRectMake(0, 0, circleWidth, circleWidth)];
_circle.center = self.view.center;
[self.view addSubview:_circle];

刷新进度

_circle.progress = value;

实现原理请参考我的博文

个人开发过的UI工具集合 XLUIKit

xlcircleprogress's People

Contributors

mengxianliang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

xlcircleprogress's Issues

endPoint的位置计算有问题 会导致endPoint位置不对

原本代码:
_endPoint.frame = CGRectMake(0, 0, _lineWidth - endPointMargin2,_lineWidth - endPointMargin2);

rect.origin.x = x + endPointMargin;
rect.origin.y = y + endPointMargin;

修改如下:
_endPoint.frame = CGRectMake(self.bounds.size.width/2 - endPointMargin/2, - endPointMargin/2, endPointMargin,endPointMargin);

x -= (_endPoint.bounds.size.width/2.0f - _lineWidth/2.0f);
y -= (_endPoint.bounds.size.width/2.0f - _lineWidth/2.0f);

other

可以给添加动画一起更像圆形进度
[self.progressLayer addAnimation:pathAnimation forKey:@“progressLayerAnimation”];
[self.endPoint.layer addAnimation:endPointAnimation forKey:@“endPointAnimation”];

other

可以把颜色方法
@属性(非原子,强)的UIColor * BGCOLOR;
@属性(非原子,强)NSArray * circleColorArray;
@Property(assign,nonatomic)CGFloat lineWidth;
........

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.