CNContactViewController隐藏导航栏

用户名

当我将推入CNContactViewControllerUITableViewController子类堆栈时UINavigationController,顶部导航栏几乎被完全隐藏。但是,随着亮度一直上升,您可以看到向后箭头,后跟单词“ Detail”和系统状态栏。当我点击屏幕的那个角落时,CNContactViewController确实被关闭了。

在此处输入图片说明

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

有什么方法可以使CNContactViewController的导航栏色调与显示它的视图控制器相同(我的应用程序的其余部分)?

CNContactViewController *controller = [CNContactViewController viewControllerForUnknownContact:person];

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

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

I should note that I'm only experiencing this problem on iOS 10, and not versions below 10. I also do get the properly tinted navigation bar when I tap "Add to Existing Contact", but it breaks again when that view controller is dismissed.

在此处输入图片说明

So again, my question is: Is there any way to make the navigation bar tint of the CNContactViewController be the same as the view controller that showed it (the rest of my app)?

matt

Your second screen shot shows the reason for this problem: you have set the tint color for your bar (or bar button items in general) to be white. Hence, they are white in front of the transparent navigation bar and white background in the contact view controller.

You can't do anything directly about the bar tint color, but you can solve this in either of two ways:

  • One is to make your navigation bar nontranslucent. In that case, the contact view controller's navigation bar will be black, and your white bar button items will be visible.

  • Another approach is to change your navigation bar's tint color (not the bar tint color, but the tint color that it communicates down to its bar button items) as the contact view controller pushes, and change it back when it pops.

编辑好的,我看到还有一个问题,因为“新建联系人”视图控制器是在您面前出现的另一个视图控制器。如果拒绝放弃白色条形按钮项目设置,则在按下联系人视图控制器时必须使用外观代理将UIBarButtonItem的颜色设置为其他颜色,然后在导航控制器时将其重置为白色委托告诉您用户正在弹出您的视图控制器。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章