我继承ABPeoplePickerNavigationController
,我想知道怎么躲右工具栏项目“Cancel
”?的ABPeoplePickerNavigationController隐藏取消按钮
我一直在寻找,但我无法找到合适的解决方案。
谢谢!
我继承ABPeoplePickerNavigationController
,我想知道怎么躲右工具栏项目“Cancel
”?的ABPeoplePickerNavigationController隐藏取消按钮
我一直在寻找,但我无法找到合适的解决方案。
谢谢!
使用<UINavigationControllerDelegate>
后ABPeoplePickerNavigationController alloc
它代表自我。
peoplePicker.delegate = self;
我们需要重写的UINavigationController
的委托方法。
//当导航控制器通过按下,弹出或设置视图控制器堆栈显示新的顶视图控制器时调用。
- (void)navigationController:(UINavigationController*)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if([navigationController isKindOfClass:[ABPeoplePickerNavigationController class]])
navigationController.topViewController.navigationItem.rightBarButtonItem = nil;
}
你为什么要躲呢..? – aBilal17 2013-03-05 13:43:34
您是否尝试过'peoplePicker.topViewController.navigationItem.leftBarButtonItem = nil;'? – jjv360 2013-03-05 13:46:50
@ jjv360谢谢,但它不起作用,rightBarButtonItem仍然可见 – jkigel 2013-03-05 13:58:14