I am trying to show up contacts from iPhone contacts book in UITabBarController. I came so far:
- (void)contacts
{
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
// place the delegate of the picker to the controller
picker.peoplePickerDelegate = self;
CGRect newFrame = self.tabBarController.view.frame;
newFrame.size.height = newFrame.size.height - 49;
picker.view.frame = newFrame;
[picker setAccessibilityViewIsModal:YES];
// showing the picker
[self.tabBarController presentModalViewController:picker animated:NO];
}
Calling:
-(void)viewWillAppear:(BOOL)animated
{
[self contacts];
}
As the result I am getting this:

- I can’t see the tabs
- My tabs style is black, but the picker is blue.
- There’s the cancel button.
How to make tabs visible, make style black and get rid of cancel button?
Thank you in advance.
EDIT:
After changing the method:
-(void)contacts
{
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
picker.navigationBar.tintColor=[UIColor blackColor];
// Display only a person's phone, email, and birthdate
NSArray *displayedItems = [NSArray arrayWithObjects:[NSNumber numberWithInt:kABPersonPhoneProperty], nil];
picker.displayedProperties = displayedItems;
// Show the picker
picker.navigationBar.hidden=YES;
CGRect newFrame = picker.view.frame;
newFrame.size.height = newFrame.size.height - 49;
picker.view.frame = newFrame;
[self.tabBarController.view addSubview:picker.view];
}
I’ve got this result:

Yes the contacts are sitting inside the tab, but now have the problems:
- When I touch the the tableView with contacts, the contacts are disappearing at all.
- When I switch the tabs, the contacts view doesn’t go away and I can see it in all the tabs.
- The half of UISearchbar stays hidden.
Where’s the evil now?
I’m hoping you figured this out by now, but it’s because a modal view controller is added to the top of the active window. That’s why it goes over the top of your tab bar.
UIViewControlleralso has a methodpresentViewController:animated:completion:that will probably work better for you. You have some animation options if you specify the type for the animation using themodalTransitionStyleproperty. Good luck (if it’s even still a question).