【发布时间】:2021-02-10 21:58:51
【问题描述】:
我不希望我的Image 或Text 像我的按钮那样有灰色背景。我正在使用List,以便用户可以在按钮之间向下滚动。
struct ContentView: View {
var body: some View {
List {
Image("Forest1")
.resizable()
.aspectRatio(contentMode: .fill)
.padding(.all)
.background(Color.black.ignoresSafeArea())
Text("Welcome Back!")
.padding()
.background(Color.black.ignoresSafeArea())
Button(action: PLACEHOLDER) {
Text("Shake Tree")
}
Button(action: PLACEHOLDER) {
Text("Open Forge")
}
Button(action: PLACEHOLDER) {
Text("Open Cabin")
}
Button(action: PLACEHOLDER) {
Text("Open Map")
}
}
}
}
【问题讨论】: