/ Published in: Objective C

This adds a spinning activity indicator to the top navigation bar of a navigation controller.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// 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]; statusInd.style = UIBarButtonItemStylePlain; [tempNavigationController.navigationItem setRightBarButtonItem: statusInd animated:YES];
Comments
