I have a SwiftUI section like so:
struct FormView: View {
var body: some View {
Form {
Section {
Button(action: {
}) {
HStack {
Spacer()
Text("Save")
.font(.headline)
.foregroundColor(.white)
Spacer()
}
}
.listRowInsets(.init())
.frame(height: 50)
.background(Color.blue)
.cornerRadius(15)
}.background(Color.clear)
}
//.background(Color.red)
.background(LinearGradient(gradient: Gradient(colors: [.green, .red]), startPoint: .leading, endPoint: .trailing))
.edgesIgnoringSafeArea(.all)
}
}
struct WelcomeScreen: View {
var body: some View {
FormView().background(Color.red)
.onAppear {
UITableView.appearance().backgroundColor = .clear
}
}
}
And it looks like this:
How can I get rid of the white background color of the section? I've tried adding .background(Color.clear) but that did nothing.