我有这个列表,我是一个 NavigationView。
在黑暗模式下,雪佛龙(红色圆圈)几乎看不见。
struct ContentView: View {
var body: some View {
NavigationView{
List {
Line(text: "Line 1")
Line(text: "Line 2")
Line(text: "Line 3",selected: true)
Line(text: "Line 4")
Line(text: "Line 5")
}
}
}
}
struct Line: View {
var text :String
var selected = false
@Environment(\.colorScheme) var colorScheme
var body: some View {
NavigationLink(destination: Text("D")) { Text(text)}
.listRowBackground(selected ? Color.blue : Color(.systemBackground))
.foregroundColor(selected ? Color.white : Color(.label))
.onTapGesture(perform: {print ("tap")
} )
}
}