嘿,当我的用户更改选择器轮中的选择时,我想在导航栏的右上角显示一个活动指示器。我不知道如何在那里添加活动指示器我只能在那里添加普通的导航栏按钮。有帮助吗?提前谢谢!
答案 0 :(得分:7)
UIActivityIndicatorView *activityIndicator =
[[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
UIBarButtonItem *barButton = [[UIBarButtonItem alloc]
initWithCustomView:activityIndicator];
[[self navigationItem] setRightBarButtonItem:barButton];
[barButton release];
[activityIndicator startAnimating];