1

I want to show the addressbook as a tabbar item so I defined this code in the delegate for the tab bar:

Contacts = [[ABPeoplePickerNavigationController alloc] init];

Contacts.tabBarItem.image = [UIImage imageNamed:@"Contact.png"];

Contacts.tabBarItem.title = NSLocalizedStringFromTable (@"Label_Contact_String" , language , @"");

//[Contacts.navigationController.navigationBar setBarStyle:UIBarStyleBlack];
Contacts.peoplePickerDelegate = self;   
[rootViewController addObject:Contacts];

The contacts list is shown but there is a cancel button in navigation bar that is not useful and I can't remove it from navigation bar. Can you help me? Thanks

Jonathan.
  • 53,997
  • 54
  • 186
  • 290
Fa.Shapouri
  • 988
  • 2
  • 12
  • 30

1 Answers1

2

The ABPeoplePickerNavigationController inherits from UINavigationController, so methods that work on UINavigationControllers should work on ABPeoplePickerNavigationController, unless it overrides them, which is highly likely.

You should be able to do this:

Contacts.navigationController.navigationBar.topItem.rightBarButtonItem = nil;

(that's if the cancel button is on the right, if it's on the left, just change right to left)

However it's highly likely you won't be able to and you'll just have to accept the cancel button

Jonathan.
  • 53,997
  • 54
  • 186
  • 290
  • In that case it's not possible. It was a long shot. You will gave to accept the cancel button is not removable. – Jonathan. Feb 28 '11 at 15:56