【发布时间】:2021-04-12 00:58:32
【问题描述】:
如何将List 的灰色背景设置为完全透明以让红色通过?
struct ContentView: View {
var body: some View {
NavigationView {
ZStack {
Color.red
.ignoresSafeArea()
VStack {
HStack {
Text("Faux Title")
.font(.system(.largeTitle, design: .rounded))
.fontWeight(.heavy)
Spacer()
Button(action: {
// settings
}, label: {
Image(systemName: "gearshape.fill")
.font(.system(.title2))
})
}
.padding()
.navigationBarHidden(true)
List {
Text("One")
Text("Two")
Text("Three")
}
.listStyle(InsetGroupedListStyle())
}
}
}
}
}
【问题讨论】:
标签: swiftui swiftui-list