Create a Busy Activity Indicator Spinner


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your 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];

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.