【发布时间】:2019-11-29 09:33:18
【问题描述】:
如果我列出静态项目,我无法更改视图的背景颜色。这是我的代码:
NavigationView {
ZStack {
Color("AppBackgroundColor").edgesIgnoringSafeArea(.all)
List {
Section(header: Text("Now in theaters")) {
ScrollMovies(type: .currentMoviesInTheater)
}
Section(header: Text("Popular movies")) {
ScrollMovies(type: .popularMovies)
}
}.listStyle(.grouped)
}
}
【问题讨论】:
-
您要更改
List背景颜色还是ZStack背景颜色? -
我想改变所有视图的背景。
-
嘿,你看到我的working answer了吗?
标签: ios swift list colors swiftui