I am new to iphone development. I want to set an activity indicator in the navigation bar. I see my activity indicator below the navigation bar. My code is here
- (IBAction) gomethod : (id) sender {
xxMapSubviewcontroller = [[XxMapSubviewcontroller alloc] init];
[self.navigationController pushViewController:xxMapSubviewcontroller animated:YES];
activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
activityIndicator.frame = CGRectMake(0.0, 0.0, 20.0, 20.0);
[activityIndicator startAnimating];
[xxMapSubviewcontroller.view addSubview:activityIndicator];
}
How can i set my activity indicator in the navigation bar? Please help me out. Thanks.