2

I'm trying to display more than one line of text in a custom UIMenuItem. I've tried using a simple "\n" in the title property of the UIMenuItem but with no luck. Example:

UIMenuItem *menuItem; //Is then allocated properly....

// Before the Menu is displayed
menuItem.title = @"This is a first line.\nThis is a second line.";

Unfortunately I just end up with one line being displayed...

What I want to achieve is something similar to what you can see upon a LongPress on a row in the Apple iPod/Music app.

 Multi-line UIMenuItem in iPod app

I've just found out about this github project as a solution: https://github.com/questbeat/QBPopupMenu

You can display whatever custom UIView within a MenuItem. So I inserted a multi-line UILabel and that works.

However I would rather use the native Apple UIMenutItem approach if this is possible. Any ideas? Thanks in advance.

Joss
  • 903
  • 10
  • 17

2 Answers2

1

You would need to change some internal property of the UIMenuItem, but unfortunately Apple does not provide a way to do it.

So, as for today, there's not way to change the display of a UIMenuItem.

Gabriele Petronella
  • 106,943
  • 21
  • 217
  • 235
  • 1
    Thanks for your your answer Gabriele! I guess we'll have to wait until iOS 7.0 ;-) – Joss Apr 08 '13 at 16:58
0

Have you tried '\r' instead of '\n'?

user352891
  • 1,181
  • 1
  • 8
  • 14