3

嘿,当我的用户在选择器轮中更改选择时,我想在导航栏的右上角显示一个活动指示器。我不知道如何在那里添加活动指示器我只能在那里添加普通的导航栏按钮。有什么帮助吗?提前致谢!

4

1 回答 1

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];  

这应该有效。来自:http: //iosdevelopertips.com/user-interface/adding-an-activity-indicator-spinner-to-navigation-bar.html

于 2010-12-02T19:33:22.980 回答