请参阅下面的我自己的答案,我在几个小时后想通了。希望我能节省一些时间。
我目前在我的 UI 上有一个按钮,它将模态显示一个 ABPeoplePickerNavigationController,它工作得很好。我想扩展它以实现收藏夹和最近更新,这样当用户点击按钮时,我会呈现一个 UITabBarController,其中一个选项卡上有 ABPeoplePickerNavigationController,然后是另外两个带有收藏夹和最近更新的选项卡(我猜这将是 UITableViewControllers . 我基本上希望标签栏控制器的行为类似于内置电话应用程序的模式版本,用于联系人、收藏夹和最近的标签(但不仅仅是电话号码)。
我已经到处搜索,试图找到一个关于如何做到这一点的解决方案(我是 TabBarControllers 的新手),到目前为止,我一直试图以编程方式完成它并取得了一点成功,而在 Interface Builder 中却完全没有成功,所有我曾经看到的是一个白色的屏幕呈现。
是否有一些图书馆已经做了一些我似乎无法找到联系人和收藏夹的事情?
以下是我在这两种方法中尝试过的内容及其工作原理的细分:
以编程方式:我基本上创建了 ABPeoplePickerNavigationController,就像我打算单独以模态方式呈现它一样,而是使用 setViewControllers 方法将它添加到 UITabBarController 实例。当我展示这个时,选项卡上显示“组”,我无法弄清楚如何将图标更改为联系人的系统图标,或者更改按下选项卡栏按钮的行为以不退出组(当您按下标签栏按钮时,内置电话应用程序不会备份到该级别)。就像我上面提到的,我基本上希望它的行为类似于用于联系人、收藏夹和最近的内置电话应用程序。
IB:我尝试了很多东西,但在尝试以模态方式呈现时总是只得到一个白屏。