3

I am using ABPeoplePickerNavigationController for selection of address book contact by user. With this code behind action of a button:

ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];

picker.peoplePickerDelegate = self;
picker.view.frame=self.view.frame;
[self presentModalViewController:picker animated:YES];
[picker release];

When this code runs it rotates the Landscape UI to Portrait and eventually dismisses the controller that presents this ABPeoplePickerNavigationController.

I am getting this problem only in iOS 5, iPad 2. It's working fine with iOS 6.

Marco
  • 6,692
  • 2
  • 27
  • 38
NaXir
  • 2,373
  • 2
  • 24
  • 31

1 Answers1

0

I don't believe in 5.x that landscape is supported for this picker. However, try doing it via a different PresentationStyle. I believe it should then work in landscape, i.e:

ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
picker.modalPresentationStyle  = UIModalPresentationFormSheet;
[self presentModalViewController:picker animated:YES];
svguerin3
  • 2,433
  • 3
  • 29
  • 53