[英]ABPeoplePickerNavigationController auto dismiss without showing addressbook book
I am using ABPeoplePickerNavigationController for selection of address book contact by user. 我正在使用ABPeoplePickerNavigationController来选择用户的地址簿联系方式。 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. 当此代码运行时,它将Landscape UI旋转为Portrait,并最终解除显示此ABPeoplePickerNavigationController的控制器。
I am getting this problem only in iOS 5, iPad 2. It's working fine with iOS 6. 我只在iOS 5,iPad 2中遇到此问题。它适用于iOS 6。
I don't believe in 5.x that landscape is supported for this picker. 我不相信5.x这个选择器支持横向。 However, try doing it via a different PresentationStyle. 但是,尝试通过不同的PresentationStyle来做。 I believe it should then work in landscape, ie: 我相信它应该在景观中起作用,即:
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
picker.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:picker animated:YES];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.