![](/img/trans.png)
[英]Remove cancel button in ABPeoplePickerNavigationController. Strange behavior in iOs 4.x
[英]ABPeoplePickerNavigationController hide cancel button
我是ABPeoplePickerNavigationController
子类,我想知道如何隐藏正确的工具栏项“ Cancel
”?
我一直在寻找,但我找不到合适的解决方案。
谢谢!
使用<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;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.