创建一个List
与HStack
包含您的图片。
例子:
struct ContentView: View {
var body: some View {
List {
ForEach(0 ..< 50) { index in
HStack {
Text("some text")
Spacer()
Image(systemName: "checkmark")
.foregroundColor(.green)
.frame(width: 50)
Image(systemName: "xmark")
.foregroundColor(.red)
.frame(width: 50)
}
}
}
}
}
结果:
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句