ary*_*axt 33 iphone objective-c uinavigationcontroller ios
我有一个UINavigationController
.我正在尝试在navigationBar的右侧添加多个按钮.我怎样才能做到这一点?需要什么样的按钮?UIBarButton
还是UINavigationItem
?
wzb*_*zon 28
我在Xcode 4.5,iOS 6中使用了JRTurtons的答案并且像这样实现它并且它的工作原理:
// Two buttons at the right side of nav bar
UIBarButtonItem *addAttachButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addAttachmentClicked:)];
UIBarButtonItem *sendButton = [[UIBarButtonItem alloc] initWithTitle:LS(@"Send") style:UIBarButtonItemStyleBordered target:self action:@selector(sendClicked:)];
self.navigationItem.rightBarButtonItems = @[addAttachButton,sendButton];
Run Code Online (Sandbox Code Playgroud)
但是,我应该提一下,UIBarButtonSystemItemPageCurl并不像那样工作.
Dea*_*ids 15
我确信我在开发人员参考中读到导航栏中的其他按钮不受欢迎.我现在找不到那段话.我自己没有这样做,但发现这个链接似乎正好勾勒出你需要做的事情: (http://www.mattdipasquale.com/blog/2010/11/02/how-to-add-multiple-uibarbuttonitems -to-UINavigationBar的/)
您是否考虑过使用导航控制器的工具栏属性?
归档时间: |
|
查看次数: |
26734 次 |
最近记录: |