I would like to have a bottom toolbar with SwiftUI.
The following is working in iOS 15, but not in iOS 16.
In iOS 16 the toolbar is not showing. (It’s working if I change the placement…)
Text("Content")
.toolbar {
ToolbarItemGroup(placement: .bottomBar) {
Button("Greeting") {
print("Hello world!")
}
}
}
Do you have any workaround for this?
Thanks!
3
Answers
toolbar
depends on the navigation bar so you have to have aNavigationView
/NavigationStack
https://developer.apple.com/documentation/swiftui/view/toolbar(content:)-5w0tj
It was likely a bug that it was working before.
You can hide the navigation bar if you don’t need it.
For me, any conditional
bottomBar
does not get displayed at all, even ifshowTB == true
on iOS 16.Testing on the iOS 16.1 Beta, it seems to be fixed for iOS 16.1 though.
I got the same issue. It is resolved after updating to iOS 16.1.