ZProgress 是一款非常方便的自定义进度条控件
要运行示例项目,请克隆仓库,并首先从 Example 目录运行 pod install
进度条类型
typedef NS_ENUM(NSInteger, ZProgressType) {
// 圆形进度条
ScrollToRound,
// 进度条, X 轴滑行
ScrollToX,
// 进度条, Y 轴滑行
ScrollToY
};
进度条类型
@property (nonatomic, assign) ZProgressType zprogressType;
进度条宽度,水平滚动时为高度。
@property (nonatomic, assign) CGFloat progressWidth;
进度条颜色
@property (nonatomic, strong) UIColor *progressColor;
进度条背景色
@property(nonatomic, strong) UIColor *trackTintColor;
ZProgressView *roundProgessView = [[ZProgressView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 64)];
[roundProgessView setProgress:30 / 100.0 animated:YES duration:1.2]; // 动画
roundProgessView.delegate = self; // 代理
roundProgessView.style.progressWidth = 50.0; // 进度条宽度
roundProgessView.style.zprogressType = ScrollToX; // 滚动方向
roundProgessView.style.progressColor = [UIColor redColor]; // 进度条颜色值
roundProgessView.style.trackTintColor = [UIColor greenColor]; // 进度条背景色
roundProgessView.backgroundColor = [UIColor grayColor];
[self.view addSubview:roundProgessView];
ZProgress 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile
pod "ZProgress"
zhuayi, [email protected]
ZProgress 可在 MIT 许可证下使用。有关更多信息,请参阅 LICENSE 文件。