Tag: 活动指标

如何在导航栏中设置活动指示器?

我是iphone开发的新手。我想在导航栏中设置一个活动指示器。我在导航栏下面看到我的活动指示器。我的代码在这里 -(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]; } 我如何设置我的活动指标在导航栏? 请帮我。谢谢。