![](/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.