我遇到了一个非常奇怪的问题,我可以设置 UITabBarController 的 moreNavigationController 的所有属性,但 rightBarButtonItem 属性除外。我猜这可能是因为一些与可定制的ViewControllers 属性相关的错误禁用了所有右栏按钮项。任何想法如何解决?
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemDone
target:self
actionselector(popViewController)];
self.customizableViewControllers = nil;
self.moreNavigationController.navigationBar.barStyle = UIBarStyleBlack;
self.moreNavigationController.topViewController.navigationItem.title = @"test"; //this works
self.moreNavigationController.topViewController.navigationItem.leftBarButtonItem = doneButton; // this works
self.moreNavigationController.topViewController.navigationItem.rightBarButtonItem = doneButton; // this doesn't
Best Answer-推荐答案 strong>
好的解决方案是使用 moreNavigationController 的委托(delegate)
- (void)navigationControllerUINavigationController *)navigationController willShowViewControllerUIViewController *) viewController animatedBOOL)animated {
viewController.navigationItem.rightBarButtonItem = doneButton;
}
关于iphone - 无法设置 UITabBarController 的 moreNavigationController 的右键,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/5325827/
|