Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

hide "Cancel" button ABPeoplePickerNavigationController and add another button performs like Cancel button.

View gist:2970980
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
//picker is ABPeoplePickerNavigationController
[self presentModalViewController:picker animated:YES];
UIButton* backButton= [[UIButton alloc]initWithFrame:CGRectMake(9, 25, 35, 35)];
[backButton setImage:[UIImage imageNamed:@"btnBack.png"] forState:UIControlStateNormal];
[backButton addTarget:picker.topViewController.navigationItem.rightBarButtonItem.target action:picker.topViewController.navigationItem.rightBarButtonItem.action forControlEvents:UIControlEventTouchUpInside];
[picker.navigationBar.superview addSubview:backButton];
//or you can use leftBarButtonItem instead of UIButton
//picker.topViewController.navigationItem.leftBarButtonItem= [[UIBarButtonItem alloc]initWithCustomView:backButton];
picker.topViewController.navigationItem.rightBarButtonItem=nil;
 
//hide search bar in UITableView in ABPeoplePickerNavigationController
//NSLog(@"%d",picker.topViewController.view.subviews.count);
//NSLog(@"%@", [[picker.topViewController.view.subviews objectAtIndex:0] class]);
//UITableView* tableView=[picker.topViewController.view.subviews objectAtIndex:0];
//tableView.tableHeaderView=nil;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.