the code below is a swiftui ios project with catalyst turned on. when i run this on the mac, and click on the accounts item in the first navigation view it loads the accounts view fine but there is a few lines of extra space above the header. how do i remove that space?
import SwiftUI
struct ContentView: View {
init() {
UITableView.appearance().separatorStyle = .none
}
var body: some View {
NavigationView {
List {
NavigationLink("Accounts", destination: AccountsView())
NavigationLink("Budgets", destination: BudgetsView())
}
.navigationBarTitle("Sidebar")
.navigationBarHidden(true)
}
}
}
struct AccountsView: View {
@State var accounts: [Account] = [
Account(name: "Account #1"),
Account(name: "Account #2"),
Account(name: "Account #3"),
Account(name: "Account #4"),
]
var body: some View {
NavigationView {
List(accounts) { account in
NavigationLink(account.name, destination: Text(account.name))
}
.navigationBarTitle("Accounts")
}.background(Color(.purple))
}
}
struct BudgetsView: View {
var body: some View {
Text("Budgets")
}
}
struct Account: Identifiable {
var id: UUID = UUID()
var name: String
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}