Hi there,
With the following code on iOS 15, the header text is aligned with the text within the List or Form:
Form {
Section {
Text("Hello, world!")
} header: {
Text("Section Header").sectionHeaderStyle()
}
}
.listStyle(InsetGroupedListStyle())
//...
public extension Text {
func sectionHeaderStyle() -> some View {
self
.font(.system(.title3))
.fontWeight(.bold)
.foregroundColor(.primary)
.textCase(nil)
}
}
However, back on iOS 14, the analogous code aligns the header with the List Section itself:
Form {
Section(header: Text("Section Header").sectionHeaderStyle()) {
Text("Hello, world!")
}
}
.listStyle(InsetGroupedListStyle())
Does anyone know how to get the iOS 14 behavior of aligning the section header with the List Section itself, and not aligning with the text within the Section?