我有一個List與Sections :
List {
ForEach((1...3), id: .self) { _ 在中
Section(
頭部。Text("My Section"/span>)
.font(.system(.title3))
.fontWeight(.bold)
.foregroundColor(.primary)。
內容。{
ForEach((1...5), id: .self) { _ 在中
Text("My Row"/span>)
}
}
)
}
}
以下是使用iOS 14.5的iPhone 8模擬器的結果:
我希望iOS15的串列與iOS14.5的串列相等。我可以通過在List中添加.listStyle(PlainListStyle())來移除水平填充,但該部分的標題仍然有不同的垂直填充。
是否有辦法擁有與iOS14.5相同的垂直標題填充?
環境。
環境:
CodePudding
使用.listStyle()修改器將list的樣式改為GroupedListStyle。
.listStyle(GroupedListStyle()
沒有灰色背景的頁眉
頁眉
.listStyle(PlainListStyle()
更多資訊
https://developer.apple.com/documentation/swiftui/liststyle
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/324719.html
標籤:
上一篇:升級到Xcode13RC和最新的RevenueCat軟體包,現在購買的東西不能與watchOS一起使用了。
下一篇:多對多的關系prisma



