How To Change The Background Color for A Form In Swift UI?
All SwiftUI’s List
s are backed by a UITableView
in iOS. so you need to change the background color of the tableView. But since Color
and UIColor
values are slightly different, you can get rid of the UIColor
.
struct ContentView: View { init(){ UITableView.appearance().backgroundColor = .clear } @State var value = "" var body: some View { Form { Section(header: Text("First Name")) { TextField("First Name", text: $value) } Section(header: Text("Last Name")) { TextField("Last Name", text: $value) } } .foregroundColor(Color.blue) .background(Color.yellow) } }