一直觉得自己写的不是技术,而是情怀,一个个的教程是自己这一路走来的痕迹。靠专业技能的成功是最具可复制性的,希望我的这条路能让你们少走弯路,希望我能帮你们抹去知识的蒙尘,希望我能帮你们理清知识的脉络,希望未来技术之巅上有你们也有我。
OC Control FHXAnimationProgress(进度条)下载链接
今天是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];