I do not understand what is happening here.
In this example, the toolbar has three Button
and one Menu
inside an HStack
, where the every button has a .buttonStyle(_:)
set.
ToolbarItem(placement: .bottomBar) {
HStack {
Button {} label: { Label("Foo", systemImage: "square") }
.buttonStyle(.bordered)
Button {} label: { Label("Bar", systemImage: "circle") }
.buttonStyle(.borderless)
Menu {
Button {} label: { Label("One", systemImage: "figure.arms.open") }
Button {} label: { Label("Two", systemImage: "figure.2.arms.open") }
} label: { Label("Baz", systemImage: "star") }
Button {} label: { Label("Quux", systemImage: "triangle") }
.buttonStyle(.borderedProminent)
}
}
Please note: the menu has a star icon.
This causes only the menu button to appear, but with the first button's icon:
If a single button have has its styles removed, the toolbar appears as expected (in this example all button styles are removed):
This example uses the bottom bar, but also happens when using placement: .navigation
, placement: .topBarLeading
, placement: .topBarTrailing
.