下面是代码:
struct DetailView: View {
let trafficRule: [(String, String)] = [("123","rule1"),("123","rule2")]
var body: some View {
List(trafficRule, id: \.self) { trafficRule in
Text("\(trafficRule.0)")
Spacer()
Text("\(trafficRule.1)")
}
}
列表块显示错误消息。