ZZCircleProgress.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // ZZCircleProgress.h
  3. // ZZCircleProgressDemo
  4. //
  5. // Created by 周兴 on 2018/5/16.
  6. // Copyright © 2018年 zhouxing. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "ZZCountingLabel.h"
  10. #define ZZCircleDegreeToRadian(d) ((d)*M_PI)/180.0
  11. #define ZZCircleRGB(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
  12. #define ZZCircleSelfWidth self.frame.size.width
  13. #define ZZCircleSelfHeight self.frame.size.height
  14. @interface ZZCircleProgress : UIView
  15. //图形定制
  16. @property (nonatomic, strong) UIColor *pathBackColor;/**<线条背景色*/
  17. @property (nonatomic, strong) UIColor *pathFillColor;/**<线条填充色*/
  18. @property (nonatomic, strong) UIImageView *pointImage;/**<小圆点图片*/
  19. @property (nonatomic, strong) ZZCountingLabel *progressLabel;
  20. @property (nonatomic, strong) UIImageView *coinImg;
  21. //角度相关
  22. @property (nonatomic, assign) CGFloat startAngle;/**<起点角度。角度从水平右侧开始为0,顺时针为增加角度。直接传度数 如-90 */
  23. @property (nonatomic, assign) CGFloat reduceAngle;/**<减少的角度 直接传度数 如30*/
  24. @property (nonatomic, assign) CGFloat strokeWidth;/**<线宽*/
  25. @property (nonatomic, assign) CGFloat duration;/**<动画时长*/
  26. @property (nonatomic, assign) BOOL showPoint;/**<是否显示小圆点*/
  27. @property (nonatomic, assign) BOOL showProgressText;/**<是否显示文字*/
  28. @property (nonatomic, assign) BOOL increaseFromLast;/**<是否从上次数值开始动画,默认为NO*/
  29. @property (nonatomic, assign) BOOL prepareToShow;/**<是否准备好显示, 如果创建好就显示必须在设置完其他属性后最后设置此属性为YES*/
  30. //进度
  31. @property (nonatomic, assign) CGFloat progress;/**<进度 0-1 */
  32. //初始化
  33. - (instancetype)initWithFrame:(CGRect)frame
  34. pathBackColor:(UIColor *)pathBackColor
  35. pathFillColor:(UIColor *)pathFillColor
  36. startAngle:(CGFloat)startAngle
  37. strokeWidth:(CGFloat)strokeWidth;
  38. @end