How to put a view on the back button of navigation bar?

privateson used Ask the Experts™
Hey guys, I am wondering how to put a view on the back button of navigation bar?
Not on title view, but on the back button.
It seems like to me that the back button is a UIBarButtonItem, which doesn't inherite UIView...
Help please!


Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
UIBarButtonItem has initWithCustomView.
So if you will create UIButton, then you can write something like:
UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:theUIButtonYouCreated];

Here you will see a short example:
How to use a custom UIBarButtonItem to display a UIActivityIndicatorView

Actually this class has initWithImage too.
you can either use apple's api for [[UIBarButtonItem alloc] initWithCustomView: aView];
or three20's library
TTButton *aButton = [TTButton buttonWithStyle:@"toolbarBackButton" title:@"back"];
and then add a subview on top of that button.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial