How can I create a button with a UIActivityIndicator in my navigation bar with the same style as nor

Posted by Jarin Udom on Stack Overflow See other posts from Stack Overflow or by Jarin Udom
Published on 2009-03-12T17:33:53Z Indexed on 2010/03/09 6:36 UTC
Read the original article Hit count: 339

All of the examples I've seen on here and other sites involved creating a UIActivityIndicatorView and loading it with something like:

self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] 
    			   initWithCustomView:myActivityIndicatorView 
    			   target:nil 
    			   action:nil] 
    			  autorelease];

However, that just creates a plain activity indicator in the navigation bar. What I want to do is have a button that looks just like the normal UIBarButtonSystemItem buttons but with an activity indicator instead of one of the default images. I've tried doing initWithImage and initWithTitle with nil images or titles and then adding the activity indicator as a subview, but that doesn't work.

Any ideas?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk