I've been trying to reduce the space between sections in a list with the GroupedListStyle()
applied without any luck.
Code from above screenshot:
struct ContentView: View {
var body: some View {
List {
Section {
Text("Hello, World!")
Text("Hello, World!")
Text("Hello, World!")
}
Section {
Text("Hello, World!")
}
Section {
Text("Hello, World!")
Text("Hello, World!")
}
}.listStyle(GroupedListStyle())
}
}
Any suggestions would be greatly appreciated.
You can add it outside the view like this
struct ContentView: View {
init() {
UITableView.appearance().sectionFooterHeight = 0
}
var body: some View {}
}
I don't like this solution but I thought back to how UITableView
works and guessed that it was probably the footer spacing causing this.
I added:
UITableView.appearance().sectionFooterHeight = 0
to the init of the view and that seems to have worked.
I am aware that this sets that appearance globally so potentially it will be good to reset that value when the view disappears.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With