I have a List:
List {
ForEach(model.sections) { s in
Section(header: SectionView()) {
ForEach(items, id: \.self) { item in
Text(item.name)
.border(Color.mint)
}
}
}
}
.listStyle(.plain)
I have the view SectionView I want to build for the section header:
struct SectionView: View {
var body: some View {
GeometryReader { geo in
HStack {
Text("Section Header View")
.frame(width: geo.size.width, height: 60)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.border(Color.green)
}
}
}
Unfortunately the SectionView in the header now bleeds over the cells. The actual section header height did not change. How can I set a custom section header height?


