如何将导航“后退按钮”(自动创建)的颜色更改为黑色,将 DisclosureGroup“雪佛龙”的颜色更改为另一种颜色?
我试过做.buttonStyle(PlainButtonStyle())
和 .foregroundColor(.black)
struct ContentView: View {
var body: some View {
NavigationView {
NavigationLink(destination: DetailView()) {
Text("Go to details ->")
.foregroundColor(.purple)
.underline()
}
}
}
}
struct DetailView: View {
@State private var isExpanded = false
var body: some View {
VStack {
DisclosureGroup("All Details", isExpanded: $isExpanded) {
}.buttonStyle(PlainButtonStyle())
.foregroundColor(.black)
Spacer()
}
.padding()
}
}