Code Monkey home page Code Monkey logo

zzcircleprogress's Introduction

ZZCircleProgress

Language Pod Version Pod Platform Pod License Carthage compatible

ZZCircleProgress 是一款可以高度自定义的环形进度条。你能看到的任何地方都可以进行自定义,包括圆环的开始角度、缺少角度、以及动画时长、动画刷新方式等等。而且相关的属性设置支持动态化,你可以在进度条加载完成之后随时更改他们的属性。

特点

  • 可以自定义所有东西。
  • 采用CAAnimation方式实现进度动画,保证了进度条的性能及流畅度。
  • 设置开始角度及减少角度时直接传入对应的角度即可(0-360),无需进行转换。
  • 可以在进度条初始化完成之后再次更改进度条的起始角度等属性。
  • 可以通过storyboard、xib及纯代码方式加载。
  • 支持cocoapods。
  • 支持iOS7.0及之后的版本。

安装方式

通过CocoaPods。

pod 'ZZCircleProgress'

pod 'ZZCircleProgress', '~> 0.2.1'

由于上传到CocoaPods没多久。可能需要pod setup初始化一下。

使用方法

通过storyboard或xib方式加载。

拖入一个UIView到故事板中,并指定Class为ZZCircleProgress即可。

纯代码方式加载。

ZZCircleProgress *progressView = [[ZZCircleProgress alloc] initWithFrame:CGRectMake(100, 100, 100, 100) pathBackColor:[UIColor lightGrayColor] pathFillColor:[UIColor redColor] startAngle:0 strokeWidth:20];
progressView.prepareToShow = YES;//设置完进度条相关属性后需要设置此属性为YES,否则设置progress之前进度条不显示。
[self.view addSubview:progressView];

初始化提供了设置坐标、线条背景色、线条填充色、开始角度及线条宽度的方法。可以设置相关属性如下。

progressView.reduceAngle = 30;//整合进度条缺少30度
progressView.pointImage.image = [UIImage imageNamed:@"test"];//设置小圆点图片
progressView.duration = 2.0;//动画时长。默认为1.5
progressView.showPoint = NO;//是否显示默认小圆点。默认为YES
progressView.showProgressText = NO;//是否显示默认进度文本。默认为YES
progressView.increaseFromLast = YES;//进度条动画是否从上次进度开始动画。默认为NO
progressView.progressLabel......//progressLabel集成自UILabel。属性随意设置

设置完相关属性记得调用progressView.prepareToShow = YES;

效果展示

image

更新历史:

  • 2018.05.26:解决iOS10以下设备可能报错的问题。frameInterval和preferredFramesPerSecond进行版本判断。
  • 2018.05.16:发布0.1.0版本及0.2.0版本到cocoapods。(0.1.0版本包括以前draw rect实现的进度条)
  • 2018.03.09:ZZCACircleProgress支持属性动态修改,具体实例见demo,ZZCircleProgress增加动画时长属性。
  • 2017.11.24:懒加载提前调用问题修复
  • 2017.08.30:修复xib方式导入不显示的问题

问题反馈

如果使用过程发现什么问题可以随时联系我QQ:1098660224,微信:zhouxing5311或提issues。

zzcircleprogress's People

Contributors

zhouxing5311 avatar

Watchers

Hubin_Huang avatar

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.