Objective c ABPeoplePickerNavigationController在不显示通讯簿的情况下自动关闭
我正在使用ABPeoplePickerNavigationController按用户选择通讯簿联系人。此代码隐藏在按钮操作的后面:Objective c ABPeoplePickerNavigationController在不显示通讯簿的情况下自动关闭,objective-c,ios5,uiinterfaceorientation,ipad,addressbookui,Objective C,Ios5,Uiinterfaceorientation,Ipad,Addressbookui,我正在使用ABPeoplePickerNavigationController按用户选择通讯簿联系人。此代码隐藏在按钮操作的后面: ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init]; picker.peoplePickerDelegate = self; picker.view.frame=self.view.frame; [self presentMod
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
picker.view.frame=self.view.frame;
[self presentModalViewController:picker animated:YES];
[picker release];
当此代码运行时,它将横向UI旋转为纵向,并最终取消显示此ABPeoplePickerNavigationController的控制器
我只在iOS5和iPad2上遇到这个问题。它在iOS 6上运行得很好。我不相信5.x支持此选择器的横向功能。但是,请尝试使用不同的演示方式。我认为它应该适用于景观,即:
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
picker.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:picker animated:YES];