簡體   English   中英

ABPeoplePickerNavigationController隱藏取消按鈕

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM