我无法让我的活动指标正常工作。需要活动指标帮助
这里就是我的GOT
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:YES];
//Create an instance of activity indicator view
UIActivityIndicatorView * activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
//set the initial property
[activityIndicator stopAnimating];
[activityIndicator hidesWhenStopped];
//Create an instance of Bar button item with custome view which is of activity indicator
UIBarButtonItem * barButton = [[UIBarButtonItem alloc] initWithCustomView:activityIndicator];
//Set the bar button the navigation bar
[self navigationItem].rightBarButtonItem = barButton;
//Memory clean up
[activityIndicator release];
[barButton release];
}
是应该得到的代码就开始的部分,然后ended--
...
else if ([theSelection isEqualToString: @"Update statistics"])
{
[self startTheAnimation];
[updateStatistics updateThe2010Statistics];
[self stopTheAnimation];
}
...
-(void)startTheAnimation {
[(UIActivityIndicatorView *)[self navigationItem].rightBarButtonItem.customView startAnimating];
}
-(void)stopTheAnimation {
[(UIActivityIndicatorView *)[self navigationItem].rightBarButtonItem.customView stopAnimating];
}
它是否显示,但不是动画或甚至没有出现? – progrmr 2010-07-23 17:29:33