OC Control FHXAnimationProgress(进度条)

一直觉得自己写的不是技术,而是情怀,一个个的教程是自己这一路走来的痕迹。靠专业技能的成功是最具可复制性的,希望我的这条路能让你们少走弯路,希望我能帮你们抹去知识的蒙尘,希望我能帮你们理清知识的脉络,希望未来技术之巅上有你们也有我。

OC Control FHXAnimationProgress(进度条)下载链接

OC 项目底层框架(万能)

今天是2021年春节 初一 祝大家春节快乐

在这里插入图片描述
提供的方法

#pragma mark --- Configuring Progress

/**
 进度 atomic 原子性,
 */
@property (atomic, assign)CGFloat   progress;


/**
 设置进度
 
 @param progress 进度
 @param animated 是否需要动画
 */
- (void)setProgress:(CGFloat)progress animated:(BOOL)animated;



/**
 进度条颜色数组,多组颜色会设置成渐变色
 设置该属性后, 属性progressTintColor将会失效
 */
@property (nonatomic, strong) NSArray  *progressTintColors;


/**
 进度条颜色
 default is view backgroundColor.
 */
@property (nonatomic, strong)UIColor   *progressTintColor;


/**
 进度条是否内嵌
 default  is  0.
 */
@property (nonatomic, assign)CGFloat    progressViewInset;


/**
 圆角
 default is half of height.
 */
@property (nonatomic, assign)CGFloat    progressCornerRadius;


#pragma mark --- Configuring Stripes


/**
 条纹是否运动
 defau  is NO.
 */
@property (nonatomic, getter = isStripesAnimated)BOOL stripesAnimated;


/**
 条纹运动位移
 default is 1
 */
@property (nonatomic, assign)double stripesAnimationVelocity;



/**
 条纹倾斜方向
 default is LRStripesOrientationRight
 */
@property (nonatomic, assign)LRStripesOrientation stripesOrientation;


/**
 条纹宽度
 default is 10.0f
 */
@property (nonatomic, assign)NSInteger stripesWidth;


/**
 条纹颜色
 default is purple color
 */
@property (nonatomic, strong)UIColor *stripesColor;


/**
 条纹的倾斜角度
 default is 5.0f
 */
@property (nonatomic, assign)NSInteger stripesDelta;


/**
 是否隐藏条纹
 default is NO
 */
@property (nonatomic, assign)BOOL hideStripes;


#pragma mark --- Configuring Track

/**
 是否隐藏轨迹
 default is NO
 */
@property (nonatomic, assign)BOOL hideTrack;


/**
 轨迹颜色
 default is black color
 */
@property (nonatomic, strong)UIColor  *trackTintColor;


#pragma mark --- Configuring Node


/**
 节点个数
 you can set number of nodes between 2 and 5.
 
 */
@property (nonatomic, assign)NSInteger numberOfNodes;


/**
 节点颜色
 default is track tint color.
 if no track tint color,you need set a color.
 */
@property (nonatomic, strong)UIColor   *nodeColor;


/**
 节点高亮颜色
 node had been selected.
 default is progress tint color.
 if no progress tint color, you need set a color.
 */
@property (nonatomic, strong)UIColor   *nodeHighlightColor;


/**
 节点周围的圆环效果
 default is YES.
 */
@property (nonatomic, assign)BOOL hideAnnulus;

- (instancetype)initWithFrame:(CGRect)frame;

使用

//进度条的使用要封装多一个view才能够使用,不然用frame约束会出错。
@property (nonatomic,strong) FHXAnimationProgress *progressView;

    self.progressView = [FHXAnimationProgress new];
    self.progressView.addTo(self.view);
    self.progressView.makeCons(^{
      make.left.equal.view(self.view).constants(15);
      make.bottom.equal.view(self.view).constants(-20);
      make.height.equal.constants(10);
      make.width.equal.constants(200);
    });
    //  self.progressView.frame = CGRectMake(5, self.view.frame.size.height-10-10, self.view.frame.size.width-70-15-10, 12);
    self.progressView.backgroundColor = [UIColor clearColor];
    self.progressView.layer.cornerRadius = 5;
    self.progressView.layer.masksToBounds = YES;
    self.progressView.progressTintColors = @[LRColorWithRGB(0xce2b2c),LRColorWithRGB(0xff734d)];
    //动画节条
    self.progressView.stripesWidth = 10;
    //是否开启动画
    self.progressView.stripesAnimated = YES;
    //YES渐变效果 NO折条效果
    self.progressView.hideStripes = NO;
    //节点个数
    self.progressView.numberOfNodes = 0;
    self.progressView.hideAnnulus = NO;
    //yes 已动画的形式递进(胀满)  NO没有动画  最好设置NO  防止重复刷新滚动条重复加载
    [self.progressView setProgress:0.5 animated:NO];

效果

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

冯汉栩

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值