在特定联系人处打开联系人列表
我有一个 iPhone 应用程序,它使用 ABPeoplePickerNavigationController
来选择联系人。第一次选择联系人时,联系人列表显然从顶部的字母“A”下方开始。但是,假设您在“M”下选择了一个联系人;如果您稍后想要更改选择的联系人,我想初始化联系人列表,以便它已经滚动到“M”部分。
这是我用来打开联系人列表的代码:
ABPeoplePickerNavigationController *picker =
[[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
[self presentModalViewController:picker animated:YES];
[picker release];
我在参考指南中找不到有关如何配置控制器打开位置的滚动偏移的任何信息。
I have an iPhone app that uses a ABPeoplePickerNavigationController
to pick out a contact. First time you select a contact, the contact list obviously starts at the top, under the letter 'A'. However, say you selected a contact under 'M'; if you then later want to change which contact is selected, I want to initialise the contact list so that it's already scrolled to the 'M' section.
Here's the code I use to open the contact list:
ABPeoplePickerNavigationController *picker =
[[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
[self presentModalViewController:picker animated:YES];
[picker release];
I can't find any information in the reference guide on how to configure the scroll offset where the controller opens.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此功能在
ABPeoplePickerNavigationController
中不可用。但是,您可以实现一个自定义的 UITableViewController,它使用AddressBook
框架来实现此目的。This functionality is unavailable in
ABPeoplePickerNavigationController
. However you can implement a customUITableViewController
which does that using theAddressBook
framework.尝试使用 [ABAddressBook]
Try to use the [ABAddressBook]