swiftuitoolbar

toolbar .bottomBar not showing contents, and covering list


I'm trying to setup a toolbar on the bottom of the screen that shows when a list is in edit mode but I'm having 2 issues with it.

The first is I can't get it to show any of the buttons. The toolbar appears, but none of the buttons are visible.

 .toolbar {
    if editMode?.wrappedValue.isEditing == true {
        ToolbarItemGroup(placement: .bottomBar) {
            Button("Select All", role: .none) {
                selectAll()
            }
            Button("Deselect All", role: .none) {
                deSelectAll()
            }
        }
    }
    ToolbarItemGroup(placement: .navigationBarTrailing) {
        EditButton()
    }
}

The second issue is its covering the last entry on the list

enter image description here


Solution

  • Seems I have to add .navigationViewStyle(.stack) to the view that has the navigation view in order for the buttons to show