Posted By

allnatural on 04/29/10


Tagged

iphone activity busy


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

umang_nine
rvachere
bucko
Tintenklecks
cnathan


Create a Busy Activity Indicator Spinner


 / Published in: Objective C
 

URL: http://iphonedevelopertips.com/user-interface/adding-an-activity-indicator-spinner-to-navigation-bar.html

  1. // CREATE & ADD SPINNER
  2. UIActivityIndicatorView *activityIndicator =
  3. [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
  4. UIBarButtonItem * barButton =
  5. [[UIBarButtonItem alloc] initWithCustomView:activityIndicator];
  6.  
  7. // Set to Left or Right
  8. [[self navigationItem] setRightBarButtonItem:barButton];
  9.  
  10. [barButton release];
  11. [activityIndicator startAnimating];
  12.  
  13.  
  14.  
  15.  
  16. // REMOVE SPINNER
  17. [[self navigationItem] setLRightBarButtonItem:nil];
  18. [activityIndicator stopAnimating];
  19. [activityIndicator release];

Report this snippet  

You need to login to post a comment.