Saturday, October 14, 2023
HomeiOS Developmentios - SwiftUI take away extraneous padding on borderless Menu in toolbar

ios – SwiftUI take away extraneous padding on borderless Menu in toolbar


Within the following instance, I am attempting to take away padding in order that “A” appears like “C”. I can not discover any strategy to take away this padding for a Menu when inside a ToolbarItemGroup (examined in iOS 15 or iOS 16). There should not be any area between the inexperienced and pink borders in “A”. That is clearly managed by .buttonStyle(.borderless) for a Button, however the corresponding .menuStyle(.borderlessButton) doesn’t work when in a toolbar (however does work when no in a toolbar). Any concepts?

HStack {
  Button {

  } label: {
    Picture(systemName: "sq..and.arrow.up")
      .border(Colour.pink)
  }
  .buttonStyle(.borderless) // <--Eliminated in "B" beneath.
  .border(Colour.inexperienced)
  Menu {
    EmptyView()
  } label: {
    Picture(systemName: "sq..and.arrow.up")
      .border(Colour.pink)
  }
  .menuStyle(.borderlessButton) // <--Eliminated in "B" beneath.
  .border(Colour.inexperienced)
}

Image



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments