我正在为 UINavigationItem setRightBarButtonItems 使用新的 API,如下所示:
UIBarButtonItem *buttonSettings = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"settings.png"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(showSettings:)];
UIBarButtonItem *buttonLogout = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPageCurl target:self action:@selector(showSettings:)];
[[self navigationItem] setRightBarButtonItems:[NSArray arrayWithObjects:buttonLogout, buttonSettings, nil]];
但是,只有 1 个按钮(设置)出现,而注销按钮根本没有出现。我究竟做错了什么?
谢谢
最佳答案
你不能这样做:
关于objective-c - setRightBarButtonItems iOS5 不工作,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9791595/