I'm subclassing ABPeoplePickerNavigationController and I was wondering how to hide the right toolbar item "Cancel"?
I've been searching but I couldn't find the right solution.
Thanks!
Use <UINavigationControllerDelegate>
After ABPeoplePickerNavigationController alloc delegate it to self.
peoplePicker.delegate = self;
We will need to override an UINavigationController's delegate method.
// Called when the navigation controller shows a new top view controller via a push, pop or setting of the view controller stack.
- (void)navigationController:(UINavigationController*)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if([navigationController isKindOfClass:[ABPeoplePickerNavigationController class]])
navigationController.topViewController.navigationItem.rightBarButtonItem = nil;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With