0

I can't find the right way to achieve this dropdown menu in SwiftUI (specifically the upwards point on the dropdown/dialog body):

enter image description here

Obviously it's some kind of menu, and the content inside is a custom View, but the Menu I'm using, which I can't figure out how to style the button or menu view for, looks like this:

enter image description here

Menu {
    Button("Opt 1", action: {})
    Button("Opt 2", action: {})
} label: {
    Text("Options")
}
// .menuStyle(DefaultMenuStyle())
// .menuStyle(BorderedButtonMenuStyle())
   .menuStyle(BorderlessButtonMenuStyle())
   .listStyle(PlainListStyle())

None of these .menuStyle modifiers achieves it.

Edit: I am also, like in the first image, trying to have text fields and other dropdowns in this view, so a picker is not what I need I think.

956MB
  • 135
  • 2
  • 12
  • "Picker is the replacement for NSPopUpButton." – Marek H Jul 24 '21 at 16:37
  • @MarekH No unfortunately not, I'm more so talking about just the menu view itself having the upward point, and being filled with a custom view, like with text fields. So it doesnt need to be a picker I believe. – 956MB Jul 24 '21 at 16:45
  • 2
    That's popover https://stackoverflow.com/questions/64286471/how-to-center-nspopover-when-using-swiftui – Marek H Jul 24 '21 at 16:50
  • @MarekH Oh my god... I just keep getting all these similar sort of things like menu, dialog, dropdown, popover, and picker all mixed up... Thanks! – 956MB Jul 24 '21 at 16:59

0 Answers0