CNContactViewController导航栏在版本之间有所不同 [英] CNContactViewController navigation bar different between versions

查看:127
本文介绍了CNContactViewController导航栏在版本之间有所不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的色调是白色的.我们的应用程序使用CNContactViewController.在以Xcode 7为目标的iOS 8应用商店中的应用程序版本中,如果您使用的是iOS 9,我们称为CNContactViewController.后退按钮为白色,但后面带有灰色导航栏.在我们使用针对iOS 9和10的Xcode 8的开发版本中,没有灰色条,因此后退按钮在白色之上是白色,很难看到阴影.

Our tint color is white. Our app uses CNContactViewController. In our version of the app in the store built with Xcode 7 targeting iOS 8 and 9, if you were iOS 9 we called CNContactViewController. The back button is white but has a gray navigation bar behind it. In our development build using Xcode 8 targeting iOS 9 and 10, there is no gray bar, so the back button is white on top of white and very hard to see the shadow.

在CNContactViewController的导航区域已更改的Xcode版本/SDK版本之间,是否还有其他人遇到过更改?我们的应用程序中可能还会有其他更改会影响此栏吗?

Has anyone else experienced changes between Xcode versions/SDK versions that the navigation area of CNContactViewController has changed? Might there be some other change in our app that would have affected this bar?

这是我们最新版本中的图像.我确实删除了一些个人信息,所以这是中间的方框,但是您可以在左上方看到很难看到后退按钮的地方.

here is an image what it looks like in our latest build. I did delete some personal information so that's the boxes in the middle, but you can see at the top left its very hard to see the back button.

这是我们在整个应用程序中设置颜色的方式.如果白色后退按钮也使用红色的条形颜色而不是红色,则不会有问题

this is how we set the colors throughout the app. The white back button wouldn't be an issue if it also used the bar tint color of Red instead of nothing

    UINavigationBar.appearance().barTintColor = UIColor.red
    UINavigationBar.appearance().tintColor = UIColor.white
    UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.white]

我们用于将其推送到具有红色条形和白色按钮的现有导航控制器上的代码:

The code we use to push this onto our existing navigation controller that has red bar and white buttons:

let ucvc = CNContactViewController(forUnknownContact: contact)
ucvc.delegate = self
ucvc.allowsEditing = true
ucvc.allowsActions = true
ucvc.alternateName = name()
ucvc.contactStore = CNContactStore()
self.navigationController?.pushViewController(ucvc, animated: true)

推荐答案

我遇到了完全相同的问题.绝对看起来像是iOS 10的错误.无论如何,我通过将导航栏的透明度设置为false找到了解决方法.然后,将应用程序主窗口的背景色设置为导航栏希望的任何颜色.

I was having the exact same issue. It definitely seems like an iOS 10 bug. Anyways, I found a work around by setting the navigation bar's translucency to false. Then set the background color of the application's main window to whatever color you want the navigation bar to be.

一些代码段:

UINavigationBar.appearance().isTranslucent = false
UIApplication.shared.delegate?.window??.backgroundColor = UIColor.red

这篇关于CNContactViewController导航栏在版本之间有所不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆