I want to have a toolbar with placement .bottomBar
in one of my views. When navigating away and coming back however, the toolbar doesn't transition smoothly with the rest of the view - it suddenly appears, shifting the whole contents of the view up, as shown below.
This only seems to affect toolbars at the bottom of the screen - as you can see toolbars placed at the top of the screen seem to work okay.
How can I get the bottom toolbar to transition smoothly when navigating back to the first screen?
struct ContentView: View {
var body: some View {
NavigationView {
NavigationLink(
destination: Text("Destination"),
label: {
Text("Navigate")
})
.toolbar {
ToolbarItem(placement: .bottomBar) {
Text("Bottom")
}
ToolbarItem(placement: .principal) {
Text("Top")
}
}
}
}
}