Home > Software engineering >  Removing the down arrow on a toolbaritem menu
Removing the down arrow on a toolbaritem menu

Time:08-30

Is there any way to remove the down arrow on a toolbar item when you add a menu to it? It defaults to:

enter image description here

I tried styling the menu, but it does not affect that button/image.

.toolbar {
      ToolbarItem(placement: .primaryAction) {
           Menu {
               Button(action: {}) {
                  Label("Create a file", systemImage: "doc")
               }

               Button(action: {}) {
                  Label("Create a folder", systemImage: "folder")
               }
           }
           label: {
               Label("Share", systemImage: "square.and.arrow.up")
           }
      }
}

CodePudding user response:

Add .menuIndicator(.hidden) to your Menu.

  • Related