【发布时间】:2020-07-20 12:30:32
【问题描述】:
我正在尝试在 Swift UI 中绘制折线图,但无法实现 for 循环:
Path { path in
path.move(to: CGPoint(x: 20, y: 20))
ForEach(0 ..< 11) { index in
path.addLine(to: CGPoint(x: ((index * 20) + 40), y: Int(hr[index])))
}
给我一个构建错误:
类型'()'不能符合'View';只有结构/枚举/类类型可以 符合协议
【问题讨论】:
标签: swiftui