我需要在充满颜色的圆弧中显示音频测光。如果声级低,则应填充最小面积。它应该根据记录器返回的averagePowerForChannel不断填充颜色。请提出一些建议。
答案 0 :(得分:0)
使用CAShapeLayer,其值在路径更新时会更新
- (void)setAveragePowerForChannel:(CGFloat)averagePowerForChannel {
_averagePowerForChannel = averagePowerForChannel;
UIBezierPath * path = //... make a path based on the incoming data
meterLayer.path = path.CGPath;
}