【发布时间】:2020-12-31 16:14:22
【问题描述】:
如何将导航“后退按钮”(它是自动创建的)的颜色更改为黑色, 以及 DisclosureGroup “Chevron” 的颜色为另一种颜色?
我尝试过 .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()
}
}
【问题讨论】:
标签: swift swiftui swiftui-navigationview