一个圆形视图,用于以饼图样式显示进度。
您可以直接将 MPProgressPieView.h/.m
源文件添加到 Xcode 项目中。
如果您使用 CocoaPods,则将此行添加到 Podfile 中:
pod 'MPProgressPieView'
在项目中包含必要的文件后,导入 MPProgressPieView
#import "MPProgressPieView.h"
MPProgressPieView *progressPieView = [[MPProgressPieView alloc] initWithFrame:CGRectMake(0.0, 0.0, 50.0, 50.0)];
progressPieView.value = 0.25;
[self.view addSubview:progressPieView];
控件框架可以是任何大小,控件将自动在其框架内居中。
您可以使用从 UIView
继承的 backgroundColor
和 tintColor
属性来自定义控件的外观。
请参阅 头文件 以获取完整文档。
打开 Xcode 项目以查看演示应用程序。
Massimo Peri
MPProgressPieView 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。