| 测试已测试 | ✗ |
| 语言语言 | SwiftSwift |
| 许可证 | MIT |
| 发布最新发布 | 2018年2月 |
| SwiftSwift版本 | 4.0 |
| SPM支持SPM | ✓ |
由thePsguy维护。
要运行示例项目,请克隆仓库,然后首先从Example目录中运行pod install。
iOS > 7.0
ButtonProgressBar-iOS可通过CocoaPods获得。要安装它,只需在Podfile中添加以下行:
pod "ButtonProgressBar-iOS"import ButtonProgressBar_iOSvar progressButton = ButtonProgressBar(frame: CGRect)
view.addSubview(progressButton)progressButton.addTarget(nil, action: #selector(self.tapped), for: .touchUpInside)
progressButton.setTitle(Downloadpl-pds>
, for: .normal)此图像必须进行设置,因为没有默认设置。
setCompletionImage(image: UIImage)startIndeterminate(withTimePeriod time: TimeInterval)
startIndeterminate(withTimePeriod time: TimeInterval, andTimePadding padding: TimeInterval)
/
Time Padding is the duration (default 0.5), in seconds, before starting the next cycle.
Time Period is the total time (animation + padding) that 1 cycle of the loading takes.
/
stopIndeterminate() //Stops the indeterminate loading.
setProgress(progress: CGFloat, _ animated: Bool)
/
Progress ranges from 0.0 to 1.0
If animated is true, linearly animates to progress.
/
resetProgress() //Set progress to 0.0 unanimated.
setBackgroundColor(color: UIColor)
setProgressColor(color: UIColor)hideTitle( hidden: Bool)
hideImage( hidden: Bool) Needs to be called explicitly when loading determinate as well.
triggerCompletion()Pushkar Sharma,[email
protected]
灵感来源于Dribbble
安卓版本现已可用!
ButtonProgressBar-iOS遵循MIT许可协议。有关更多信息,请参阅LICENSE文件。