diff --git a/Outpost/Features/Account/SettingsView.swift b/Outpost/Features/Account/SettingsView.swift index a61804d..228d86b 100644 --- a/Outpost/Features/Account/SettingsView.swift +++ b/Outpost/Features/Account/SettingsView.swift @@ -36,10 +36,21 @@ struct SettingsView: View { } var body: some View { - ScrollView { - sectionDetail - .padding(28) - .frame(maxWidth: .infinity, alignment: .leading) + // GeometryReader + `minHeight` (not `maxHeight`) is the actual fix for + // "center short content inside a ScrollView" — a ScrollView proposes + // effectively unbounded height to its content, so `maxHeight: .infinity` + // alone just resolves to the content's own intrinsic size and does + // nothing; forcing a `minHeight` equal to the real viewport height is + // what gives `aboutDetail`'s own centered alignment somewhere to + // actually center within. Harmless for the other (already + // top/leading-aligned) sections — short ones just get blank space + // below, same as before. + GeometryReader { geometry in + ScrollView { + sectionDetail + .padding(28) + .frame(maxWidth: .infinity, minHeight: geometry.size.height, alignment: .leading) + } } .frame(maxWidth: .infinity, maxHeight: .infinity) .background(.background) @@ -340,11 +351,12 @@ struct SettingsView: View { // MARK: - About private var aboutDetail: some View { - VStack(alignment: .leading, spacing: 16) { + VStack(spacing: 16) { sectionHeader AboutInfoView() - .frame(maxWidth: 420, alignment: .leading) + .frame(maxWidth: 420) } + .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center) } // MARK: - Helpers