How can I make the text of a UIBarButtonItem wrap

2019-06-04 01:55发布

问题:

Some of the titles of view controllers in my UINavigationController are quite long, which makes the back button in the navigation bar of the next view controller in the hierarchy miss out some of the text, with a "..." instead.

How could I make the text of the back button wrap onto two lines, as with "Now Playing" in the navigation bar of iPod.app?

Thanks!

回答1:

You could use the UIBarButtonItem method initWithCustomView: then set the rightBarButtonItem property in UINavigatiobItem.