实战问题
我有一个清单:
List {
ForEach(model.sections) { s in
Section(header: SectionView()) {
ForEach(items, id: \.self) { item in
Text(item.name)
.border(Color.mint)
}
}
}
}
.listStyle(.plain)
我有SectionView我想为节标题构建的视图:
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)
}
}
}
不幸的SectionView是,标题中的内容现在在单元格上流血了。实际的节标题高度没有改变。如何设置自定义节标题高度&