如何使用底部带有标签栏的AddressBook框架显示联系人

发布于 2025-01-04 05:14:50 字数 223 浏览 3 评论 0原文

我在显示 iPhone 联系人时遇到问题。使用AddressBook,我目前可以显示所有联系人,但它就像一个新的弹出窗口,就好像我们打开了联系人应用程序一样。我想要做的是显示所有联系人并将它们保留在一页中(标签栏导航位于底部,例如 WhatsApp 应用程序联系人页面)。

我知道实现这种方法的一种方法是手动从地址簿中提取所有数据并使用表视图显示数据,但我希望找到更有效的方法来实现这一点。

TIA

I'm having trouble displaying the contacts for iPhone. Using AddressBook, I'm currently able to display all the contacts but it's like a new pop-up window as if we opened the contacts application. What I want to do is display all of the contacts and keep them in one page (with the tab bar navigation at the bottom, like WhatsApp app contact page for example).

One way I know to do this approach is to extract all the data from the address book manually and display the data using the tableview, but I hope to find more efficient way to do it.

TIA

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水中月 2025-01-11 05:14:50

试试这个代码

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath  *)newIndexPath
{
ABPersonViewController *pvc = [[ABPersonViewController alloc] init]; pvc.displayedPerson   = [searchArray objectAtIndex:[newIndexPath row]];
[[self    navigationController] pushViewController:pvc animated:YES];
}

Try this code

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath  *)newIndexPath
{
ABPersonViewController *pvc = [[ABPersonViewController alloc] init]; pvc.displayedPerson   = [searchArray objectAtIndex:[newIndexPath row]];
[[self    navigationController] pushViewController:pvc animated:YES];
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文