gpt4 book ai didi

ios - CNContactViewController 隐藏导航栏

转载 作者:可可西里 更新时间:2023-11-01 04:43:19 25 4
gpt4 key购买 nike

当我将 CNContactViewController 插入 UINavigationController 中的 UITableViewController 子类的堆栈时,顶部导航栏几乎完全隐藏.但是随着亮度一直调高,你可以看到后退箭头后面跟着“详细信息”这个词,还有系统状态栏。当我点击屏幕的那个角落时,CNContactViewController 确实被关闭了。

enter image description here

当然这不好,因为用户可能甚至看不到导航栏的文本而现在按下任何按钮将其关闭。

有没有办法让 CNContactViewController 的导航栏色调与显示它的 View Controller (我的应用程序的其余部分)相同?

CNContactViewController *controller = [CNContactViewController viewControllerForUnknownContact:person];

controller.contactStore = [[CNContactStore alloc] init];
controller.delegate = self;
controller.allowsActions = NO;

[self.navigationController pushViewController:controller animated:YES];

我应该注意,我只在 iOS 10 上遇到这个问题,而不是 10 以下的版本。当我点击“添加到现有联系人”时,我也确实得到了正确着色的导航栏,但当该 View 时它再次中断 Controller 被解雇。

enter image description here

再一次,我的问题是:有什么方法可以使 CNContactViewController 的导航栏色调与显示它的 View Controller (我的应用程序的其余部分)相同?

最佳答案

您的第二个屏幕截图显示了此问题的原因:您已将栏(或一般的栏按钮项目)的色调设置为白色。因此,它们在透明导航栏前为白色,在联系人 View Controller 中为白色背景。

您不能直接对 bar 色调做任何事情,但您可以通过以下两种方式之一解决此问题:

  • 一种方法是让您的导航栏不透明。在这种情况下,联系人 View Controller 的导航栏将为黑色,而您的白色栏按钮项目将可见。

  • 另一种方法是在接触 View Controller 按下时更改导航栏的色调(不是栏色调,而是它传达给其栏按钮项目的色调),并在它按下时将其改回流行音乐。

编辑 好的,我发现还有一个问题,因为 New Contact View Controller 是呈现在您面前的另一个 View Controller 。如果你拒绝放弃你的白色条形按钮项目设置,你将不得不使用外观代理在你按下接触 View Controller 时将 UIBarButtonItem 色调颜色设置为其他颜色,然后在你的导航 Controller 时将其重置回你的白色委托(delegate)告诉您用户正在弹出回到您的 View Controller 。

关于ios - CNContactViewController 隐藏导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40600559/

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