MM圆角进度视图 1.0.3

MM圆角进度视图 1.0.3

测试已测试
Lang语言 Obj-CObjective C
许可 MIT
Released最新发布2014年12月

Manuel de la Mata 维护。




License MIT

带有起始和结束角度配置的 iOS 圆形进度视图。

alt tag

如何安装

Podfile

platform :ios, '7.0'
pod "MMCircularProgressView", "~> 1.0.1"

旧方法

将文件夹 /MM圆角进度视图 拖入您的项目中。这就是全部。

如何使用它?

没什么可做的!首先,导入 .h 文件

#import "MMCircularProgressView.h"

然后将其声明为属性,如果您想正确访问它

@property (nonatomic, strong) MMCircularProgressView *theProgressView;

实例化它并将其添加到所需的视图中,如通常操作:(或通过 Interface Builder 创建它)

//creates and adds the datepicker at the edge of the application frame.
self.theProgressView = [[MMCircularProgressView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)];
[self.view addSubview:self.theProgressView];

设置进度

它将从 0.0 到 1.0。

[self.circularProgressView setProgress:0.5]; //this is a float value.

动画

非常简单!

[self.circularProgressView startAnimation];

自定义

您可以看到一些可更改的参数

轨道颜色

  • UIColor progressColor:自定义进度颜色。
  • UIColor trackColor:自定义轨道颜色。

自定义角度。

  • CGFloat startAngle:从 0 到 360 度。
  • CGFloat endAngle:从 0 到 360 度。

进度。

  • CGFloat initialProgress:这将帮助您确定动画应该从何处开始。

指针。

  • BOOL displayNeedle:这将显示或隐藏您在示例图像中看到的指针。
  • UIColor needleColor:指针颜色。

其他外观设置。

  • CGFloat strokeWidth:这是轨道的宽度。
  • CGFloat duration:这是从 0.0 到进度值的动画时间。

希望您喜欢它!