3

Hey, I want to display an activity indicator on the right corner of my navbar when my user changes selection in picker wheel. I have no idea how to add activity indicator there I am only able to add normal navbar buttons there. Any help? Thanks in advance!

1 Answer 1

7
UIActivityIndicatorView *activityIndicator =  
[[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];  
UIBarButtonItem *barButton = [[UIBarButtonItem alloc] 
                                         initWithCustomView:activityIndicator];  
[[self navigationItem] setRightBarButtonItem:barButton];  

[barButton release];  
[activityIndicator startAnimating];  

This should work. From: http://iosdevelopertips.com/user-interface/adding-an-activity-indicator-spinner-to-navigation-bar.html

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.