1

with bar style as BlackOpaque my people picker looks like: enter image description here

but when I want the barStyle to be BlackTranslucent, it looks like this: enter image description here

I have tried solution from here

CODE:

- (void)showPeoplePickerController
{
    ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;

NSArray *displayedItems = [NSArray arrayWithObjects:[NSNumber numberWithInt:kABPersonPhoneProperty],
                           [NSNumber numberWithInt:kABPersonEmailProperty],
                           [NSNumber numberWithInt:kABPersonBirthdayProperty],[NSNumber numberWithInt:kABPersonAddressProperty],nil];

picker.displayedProperties = displayedItems;
picker.navigationBar.barStyle = UIBarStyleBlack;

//  picker.navigationBar.translucent = YES; //uncommented for translucent bar


[self.navigationController presentModalViewController:picker animated:YES];

}

But how do I shift things from PeoplePicker down?

Community
  • 1
  • 1
Nikita P
  • 4,226
  • 5
  • 31
  • 55

2 Answers2

0

OK In place of this:

[self.navigationController presentModalViewController:picker animated:YES];

Display your ABPeoplePickerNavigationController like below:

[self.navigationController presentViewController:picker animated:YES completion:nil];

And for bar color check this line: picker.navigationBar.tintColor=[UIColor blackColor];

Vishal
  • 8,246
  • 6
  • 37
  • 52
  • i don't think this is the solution to the problem I am facing. on iOS4.2, tintcolor will not work, and presentviewcontroller works on iOS6, but how to solve the issue that on translucent bar, the tableview goes up? – Nikita P Feb 28 '13 at 11:17
0

Why are you using a translucent navigation bar in the first place? The people picker view controller isn't meant to be used with a translucent navigation bar.

If you have a good reason to do so, you'd need to do some hacking to get the content to be displayed correctly:
You have to modify the contentInset property of the displayed table view so that the content starts below the navigation bar.

BUT: There's no way to access the displayed table view, sorry.

Fabian Kreiser
  • 8,307
  • 1
  • 34
  • 60