views:

542

answers:

2

Hey all,

i want to display my Activity Indicator in the center of the Navigation Bar. At the Moment its on the rightBarButtonItem.

How can this be done?

Thanks for help!

+1  A: 

Easiest way is to add a UIActivityIndicatorView on top of your navigation bar, and show/hide it as needed.

Kristopher Johnson
+3  A: 

here's another way to insert a custom UIView directly into the UINavigationBar with UINavigationItem's property:

@property(nonatomic, retain) UIView *titleView

and where navController is the UINavigationController that your view (managed by UINavigationbar) is in...

UIActivityIndicatorView *aView = [[UIActivityIndicatorView alloc] init];

navController.navigationItem.titleView = aView;
[aView release];

should do the trick

pxl