CNContactViewController导航栏版本之间有所不同

Jas*_*ker 4 uicolor ios cncontactviewcontroller ios10 xcode8

我们的色调是白色的.我们的应用程序使用CNContactViewController.在我们使用针对iOS 8和9的Xcode 7构建的商店中的应用程序版本中,如果您是iOS 9,我们调用了CNContactViewController.后退按钮为白色,但后面有一个灰色导航栏.在我们使用针对iOS 9和10的Xcode 8进行的开发构建中,没有灰色条,因此后退按钮在白色顶部是白色的,很难看到阴影.

有没有其他人在Xcode版本/ SDK版本之间经历过CNContactViewController的导航区域已经改变的变化?在我们的应用程序中可能会有一些其他更改会影响此栏吗?

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

在此输入图像描述

编辑:这是我们在整个应用程序中设置颜色的方式.如果白色后退按钮也使用红色的条形色调而不是任何东西,那么白色后退按钮就不会出现问题

    UINavigationBar.appearance().barTintColor = UIColor.red
    UINavigationBar.appearance().tintColor = UIColor.white
    UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.white]
Run Code Online (Sandbox Code Playgroud)

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

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)
Run Code Online (Sandbox Code Playgroud)

小智 6

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

一些代码片段:

UINavigationBar.appearance().isTranslucent = false
UIApplication.shared.delegate?.window??.backgroundColor = UIColor.red
Run Code Online (Sandbox Code Playgroud)

  • 窗口的这个怪异的backgroundColor起作用了,但绝对不是干净的:)希望Apple修复此UINavigationBar外观错误! (2认同)