I have a toolbar in which I want to place two buttons in leading and trailing positions, inside an HStack. When adding a Spacer the buttons are no longer visible. Without the Spacer it works (with the buttons being centred in the HStack)
Am I doing something wrong?
Am I doing something wrong?
Code Block swift Text("Any View") .toolbar { ToolbarItem(placement: .bottomBar) { HStack { Spacer() Button(action: {}, label: { Text("Backlog") }) Button(action: {}, label: { Text("Add New") }) } } }
Seems Spacer with other Views in ToolbarItem does not work as expected.
Please try this:
Please try this:
Code Block Text("Any View") .toolbar { ToolbarItem(placement: .bottomBar) { Spacer() } ToolbarItem(placement: .bottomBar) { Button(action: {}, label: { Text("Backlog") }) } ToolbarItem(placement: .bottomBar) { Button(action: {}, label: { Text("Add New") }) } }