Ferrite-backup/Ferrite/Views/CommonViews/InlineHeader.swift
kingbri 52409099d7 Ferrite: Properly inline lists
The inset grouped list style has a top inset that adds extra space
between the navigation bar title and the list rows. Use introspect
to remove this space on UITableView and UICollectionView (for iOS 16).

Sections completely ignore the introspect changes, so add a section
header which removes the list row insets.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-09-05 18:31:44 -04:00

30 lines
562 B
Swift

//
// InlineHeader.swift
// Ferrite
//
// Created by Brian Dashore on 9/5/22.
//
import SwiftUI
struct InlineHeader: View {
let title: String
init(_ title: String) {
self.title = title
}
var body: some View {
Group {
if #available(iOS 16, *) {
Text(title)
.padding(.vertical, 5)
} else {
Text(title)
.padding(.vertical, 10)
}
}
.padding(.horizontal, 20)
.listRowInsets(EdgeInsets())
}
}