测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可 | MIT |
发布最新发布 | 2016年6月 |
由 kamarshad 维护。
要运行示例项目,请克隆仓库,并首先从 Example 目录运行 pod install
代码在 iOS 7 及以上版本上运行良好!
MKSHorizontalLineProgressView 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中即可
pod 'MKSHorizontalLineProgressView'
并按照“在您的 iOS 应用中使用”部分中提到的步骤进行
#import "MKSHorizontalLineProgressView.h"
由于它是 UIView 的子类,您必须创建其实例并在当前父视图上添加它,在这个演示中我们使用 Storyboard
创建视图。在这种情况下创建 IBOutlet 引用
@property (weak, nonatomic) IBOutlet MKSHorizontalLineProgressView *horizontalLineProgressView2
根据您的需求编写初始设置代码(查看示例调用)
(void)doIntialSetup{
//带有百分比文本的水平线
self.horizontalLineProgressView1.progressValue = 49.0f;
self.horizontalLineProgressView1.trackColor = [UIColor colorWithRed:34.0f/255.0f green:34.0f/255.0f blue:34.0f/255.0f alpha:1.0f];
self.horizontalLineProgressView1.barColor = [UIColor colorWithRed:58.0/255.0 green:170.0/255.0 blue:53.0/255.0 alpha:1];
self.horizontalLineProgressView1.barThickness = self.horizontalLineProgressView1.frame.size.height;
self.horizontalLineProgressView1.showPercentageText = YES;
//Second Horizontal line with percentage text
self.horizontalLineProgressView2.progressValue = 78.0f;
self.horizontalLineProgressView2.trackColor = [UIColor blackColor];
self.horizontalLineProgressView2.barColor = [UIColor colorWithRed:0.0f / 255.0f green:75.0f / 255.0f blue:125.0f / 255.0f alpha:1.0f];
self.horizontalLineProgressView2.barThickness = self.horizontalLineProgressView2.frame.size.height;
self.horizontalLineProgressView2.showPercentageText = YES;
//Horizontal line without percentage text
self.horizontalLineProgressView3.progressValue = 28.0f;
self.horizontalLineProgressView3.trackColor = [UIColor blackColor];
self.horizontalLineProgressView3.barColor = [UIColor colorWithRed:200.0f / 255.0f green:16.0f / 255.0f blue:46.0f / 255.0f alpha:1.0f];
self.horizontalLineProgressView3.barThickness = self.horizontalLineProgressView3.frame.size.height;
}
未来发布待办事项!
kamar shad, [email protected]
这是仓库 https://github.com/bphenriques/HorizontalProgressView 的几乎复制品
MKSHorizontalLineProgressView 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。