Created
June 22, 2012 07:23
-
-
Save apisit/2970980 to your computer and use it in GitHub Desktop.
hide "Cancel" button ABPeoplePickerNavigationController and add another button performs like Cancel button.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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