使用 CGContextSetLineDash 发出警告

Warning with CGContextSetLineDash

我正在尝试在我的应用程序中实现图表。我在我的应用程序中使用了这个 graph 库。它工作正常,但在控制台中显示以下警告 15-20 次。

CGContextSetLineDash: invalid dash array: at least one element must be non-zero.

你应该post参数值是什么。

正如我从错误消息中可以假设的那样,您的参数为 0 并且是不允许的。阅读 CGContextSetLineDash 以了解破折号选项。

// This dash shouldn't be zero
line1.lineDashLengths = [0, 0]