The .toolbar modifier on the NavigationView hides the Backbutton in a Buggy way!
Solution:
var body: some View {
VStack (alignment: .leading) {
...
}
.toolbar {
// to fix the back button disappeared
ToolbarItem(placement: .navigationBarLeading) {
Text("")
}
ToolbarItemGroup(placement: .navigationBarTrailing) {
Button("About") {
print("About tapped!")
}
Button("Help") {
print("Help tapped!")
}
}
}
}
Hope this help.
You must be logged in to post a comment.