實戰問題
我有一個清單:
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是,標題中的內容現在在單元格上流血了,實際的節標題高度沒有改變,如何設定自定義節標題高度&
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/291509.html
標籤:其他
