How do you customize UIMenu as horizontal?

838 Views Asked by At

I’m creating an app that has a UIBarButtonItem with a UIMenu.

Is there any way to customize menu entries to show horizontally and put text under the icon? I tried to read the Apple documents but I couldn’t find the way.

The iOS Notes app has a similar menu (Scan, Pin, Lock):

enter image description here

If you know how to do this, please help.

1

There are 1 best solutions below

0
On BEST ANSWER

To make a UIMenu look like the one in your screenshot where there are three buttons in the first row, change your menu's preferredElementSize to UIMenu.ElementSize.medium. Note that preferredElementSize is only available in iOS 16.0+.

yourMenu.preferredElementSize = .medium