gpt4 book ai didi

objective-c - ABPeoplePickerNavigationController 自动关闭而不显示地址簿

转载 作者:行者123 更新时间:2023-12-04 03:07:54 25 4
gpt4 key购买 nike

我正在使用 ABPeoplePickerNavigationController 由用户选择地址簿联系人。使用此代码隐藏按钮操作:

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

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

当此代码运行时,它会将横向 UI 旋转为纵向,并最终关闭呈现此 ABPeoplePickerNavigationController 的 Controller 。

我只在 iOS 5、iPad 2 上遇到这个问题。它在 iOS 6 上运行良好。

最佳答案

我不相信 5.x 中这个选择器支持横向。但是,请尝试通过不同的 PresentationStyle 来完成。我相信它应该在景观中工作,即:

ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
picker.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:picker animated:YES];

关于objective-c - ABPeoplePickerNavigationController 自动关闭而不显示地址簿,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13511710/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com