I have a toolbar in SwiftUI where two of the buttons are Menus. When I tap on the button the menu animates out into the correct position and then it flys to the top of the screen.
When I tap on the menu button I get this.
Then within 1 second the menu flys to the top of the screen and looks like this.
My toolbar code looks like this.
.toolbar {
ToolbarItemGroup(placement: .bottomBar) {
Menu {
Button { markMyLocation() } label: { Label("Mark My Location", systemImage: "location") }
... (MORE BUTTONS)
} label: {
Image(systemName: "plus")
}
.menuOrder(.fixed)
Spacer()
Menu {
Button { shareWithWebLink() } label: { Label("Share Map", systemImage: "square.and.arrow.up") }
... (MORE BUTTONS)
} label: {
Image(systemName: "square.and.arrow.up")
}
.menuOrder(.fixed)
Button {
presentHikeView()
} label: {
Image(systemName: "figure.hiking")
}
Button {
presentMapsView()
} label: {
Image(systemName: "map")
}
Spacer()
Button {
search()
} label: {
Image(systemName: "magnifyingglass")
}
}
}