使用这个动态仪表盘,您可以创建带有或没有图像的灵活仪表盘,图像在仪表盘圆圈内或圆圈外。
9.3+
您可以将 MultipleGaugeAnimated 添加为 Cocoapod 使用 'pod MultipleGaugeAnimated',或者您可以将其添加为资源
'新值' 与 '值' --> 如果您想看到动画,那么您应该从 '值' 动画仪表盘到 '新值',比如说,仪表盘的起始值是 50,那么您应该将 '值' 设置为 0 以从 0 开始动画,并将 '新值' 设置为 50,这样它就会从 0 动画到 50。
您也可以通过代码分配仪表盘的值,您只需将其连接为视图的输出口并调用即可
-(void)refreshGraph:(CGFloat)newValue withAnimation:(Boolean)withAnimation;
//从与输出连接的视图类调用上面的方法
[self.gauge refreshGraph:50 withAnimation:YES];
@property (weak, nonatomic) IBOutlet UIView *gaugeView;
@property(strong, nonatomic) Gauge *gauge;
self.gauge = [[Gauge alloc] initWithFrame:self.gaugeView.bounds];
[self.gauge setDefaultProperties];
[self.gauge setOuterTextProperties:@"outer 2" textColor:[UIColor darkGrayColor] font:[UIFont fontWithName:@"HelveticaNeue" size:11]];
[self.gauge setOuterImageProperties:[UIImage imageNamed:@"business"] imageSize:CGSizeMake(15, 15)];
self.gauge setNeedsDisplay];
[self.gaugeView addSubview:self.gauge];
//动画
[self.gauge animateGauge];