I'm trying to build a pretty simple layout with a sidebar and a detail view on iOS with SwiftUI. But it seems like it's not possible to have a large title in the detail view on the iPad. It should actually look like the Reminders app of Apple.
What I want (the blue text Reminders in the detail view):
However, in my own app, it doesn't work. I found this example by Apple about building lists and navigation: https://developer.apple.com/tutorials/swiftui/building-lists-and-navigation
But it doesn't work there as well. Even if I set the title in the LandmarkDetail.swift
like so:
VStack {
MapView(coordinate: landmark.locationCoordinate)
.frame(height: 300)
CircleImage(image: landmark.image)
.offset(x: 0, y: -130)
.padding(.bottom, -130)
VStack(alignment: .leading) {
Text(landmark.name)
.font(.title)
HStack(alignment: .top) {
Text(landmark.park)
.font(.subheadline)
Spacer()
Text(landmark.state)
.font(.subheadline)
}
}
.padding()
Spacer()
}
.navigationBarTitle(Text(verbatim: landmark.name), displayMode: .large)
I tested it on the iPhone and there it works. I also added another NavigationView
in the detail but it only made the whole thing worse. I had a large title but the title appeared below another navigation bar so with a huge margin from the top.