Return to Snippet

Revision: 21073
at December 2, 2009 18:10 by suibhne

Initial Code
// stop activity indicator
	UINavigationController *tempNavigationController = [self.navigationController.viewControllers objectAtIndex:2];		
	CGRect frame = CGRectMake(0.0, 0.0, 25.0, 25.0);  	
	UIActivityIndicatorView *loading = [[UIActivityIndicatorView alloc] initWithFrame:frame];  	
	[loading sizeToFit];  	
	loading.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin);  	
	UIBarButtonItem *statusInd = [[UIBarButtonItem alloc] initWithCustomView:loading]; = UIBarButtonItemStylePlain;  	
	[tempNavigationController.navigationItem setRightBarButtonItem: statusInd animated:YES];

Initial URL

Initial Description
This adds a spinning activity indicator to the top navigation bar of a navigation controller.

Initial Title
Add Activity Indicator to Navigation Controller Bar

Initial Tags

Initial Language
Objective C