NicoProgress
是Material进度条的iOS实现。
关于
我需要一个简单的Material Design进度条,它具有确定和不确定的状态,用于我正在工作的一个项目。我没有查看的其他库支持这两项功能;它们对调整大小或通过Interface Builder添加的处理不佳。
使用
将NicoProgressBar添加到您的nib或作为子视图以编程方式。
设置进度
progressBar.transition(to: .determinate(percentage: 0.5))
不确定
progressBar.transition(to: .indeterminate)
自定义
颜色
progressBar.primaryColor = .blue
progressBar.secondaryColor = .white
持续时间
progressBar.indeterminateAnimationDuration = 1.5
progressBar.determinateAnimationDuration = 1.5
状态
progressBar.state
case indeterminate
case determinate(percentage: CGFloat)
示例
要运行示例项目,请首先从示例目录中克隆仓库,然后运行pod install
。
需求
iOS 部署目标 >= 8.0 Swift 3.2 或 4
安装
NicoProgress 可以通过 CocoaPods 获取。要安装它,只需将以下行添加到 Podfile 中
pod 'NicoProgress'
作者
Nicolas Richard,[email protected]
许可
NicoProgress 在 MIT 许可下提供。更多详情请参阅 LICENSE 文件。