FlexibleGauge 0.1.0

FlexibleGauge 0.1.0

测试已测试
语言语言 Obj-CObjective C
许可协议 MIT
发布最新发布2017年11月

Ebru Gungor维护。




  • ebrugungor

FlexibleGauge

使用这个动态仪表盘,您可以创建带有或没有图像的灵活仪表盘,图像在仪表盘圆圈内或圆圈外。

example

example2

构建要求

iOS

9.3+

添加到项目

您可以将 MultipleGaugeAnimated 添加为 Cocoapod 使用 'pod MultipleGaugeAnimated',或者您可以将其添加为资源

用法

您可以通过界面设计器添加

1. 添加资源类

adding via designer

2. 输入强制性要求

'新值' 与 '值' --> 如果您想看到动画,那么您应该从 '值' 动画仪表盘到 '新值',比如说,仪表盘的起始值是 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];

查看示例项目以了解不同类型的仪表盘。