I have created the following project to demonstrate this issue. When I push to another view that contains a scrollView (List in this case) and a navigationTitle is defined, the navigationBar goes from LargeTitle to inline in a jerky manner. Without the navigationTitle the animation is smooth. Not sure how to resolve this:
import SwiftUI
import CoreData
enum Detail: Hashable {
case pushedView
}
struct ContentView: View {
@State private var selection: Detail?
@State private var columnVisibility = NavigationSplitViewVisibility.all
var body: some View {
NavigationSplitView(columnVisibility: $columnVisibility) {
List(selection: $selection) {
NavigationLink(value: Detail.pushedView) {
Text("Push View")
}
}
.listStyle(.insetGrouped)
.navigationTitle("Home")
} detail: {
switch self.selection {
case .pushedView:
PushedView()
default:
EmptyView()
}
}
.navigationSplitViewStyle(.balanced)
}
}
struct PushedView: View {
var body: some View {
List {
ForEach((1...30), id: \.self) {n in
Text("\(n)")
}
}
.navigationTitle("Pushed View")
}
}