I have a parent view with a NavigationStack
containing a List with NavigationLinks
, the NavigationStack
have a large title.
These NavLinks go to an other List
with Sections
in it, this List
have a inline title.
The problem appears when going back to the parent view, the NavigationStack's
title is rendered as .inline
for half a second and then go back to the .large
title place.
Here's my parent view :
struct TeamsView: View {
var body: some View {
NavigationStack {
List {
Section {
NavigationLink {
ChildView()
} label: {
Text("Test")
}
}
}
.navigationTitle("Title 1")
.navigationBarTitleDisplayMode(.large)
}
}
}
The child view :
struct ChildView: View {
var body: some View {
List {
Section {
//...
}
Section {
//...
}
}
.navigationTitle("Title 2")
.navigationBarTitleDisplayMode(.inline)
}
}
And here is a GIF of the animation problem :
I've made some tests with differents simulator devices, real device, to change where the .navigationTitle
is applied in both parent and child view, to remove the NavStack from the child view... and I couldn't find a solution.