I need to display a list of selections for the user to choose. I have examined Menu, .contextMenu(), and .popover(). While all three of these work fine, I cannot display what I need to show or I cannot style them to meet design needs. For example:
- Menu
- Only accepts a StringLiteral argument. I need it to accept a View.
- List only displays Label with text and image. I need it to accept a View. When I convert the View to an Image it clips to top and bottom.
- .contextMenu()
- I can run this on a view, but the List has the same Label problems when I attempt to display an image.
- Only displays list with longPress. It needs to be a tap.
- .popover()
- Performs everything I need for display except that in iOS it displays an arrow pointing to the parent view. I cannot have an arrow.
At this point it looks like popover is the most favorable option if I can set it up so the arrow is not displayed. From what I understand from the documentation only macOS is allowed to hide the arrow.
Is there a way to show .popover() without the arrow in iOS?
You could always build your own popover. The following techniques could be used:
ZStack..matchedGeometryEffectfor positioning.Here is an example to show how it can work: