Closed francisfeng closed 3 years ago
I have a section containing only one SwiftUI List view. How can I top-align the section title with and the list?
List
Can I achieve this with current version of Preference?
Preference
If not, maybe offer a parameter to customize this? I think I can help with it becuase I really need this.
The code:
struct ColorThemePane: View { let colorThemeOptions = ColorTheme.allCases @State var selectKeeper: Set<ColorTheme> = [Defaults[.colorTheme]] var body: some View { Preferences.Container(contentWidth: Preferences.PaneWidth) { Preferences.Section(title: "Color Theme:", bottomDivider: true) { List(colorThemeOptions, id: \.self, selection: $selectKeeper){ name in Text(name.rawValue) }.listStyle(PlainListStyle()) .frame(width: 290, height: 150) .cornerRadius(6) } } } }
The result:
Related: #56
https://github.com/sindresorhus/Preferences/releases/tag/v2.4.0
I have a section containing only one SwiftUI
List
view. How can I top-align the section title with and the list?Can I achieve this with current version of
Preference
?If not, maybe offer a parameter to customize this? I think I can help with it becuase I really need this.
The code:
The result:
Related: #56