【发布时间】:2017-01-31 19:44:32
【问题描述】:
我正在为导航栏使用背景图片。它在呈现视图控制器时使我的应用程序崩溃。我还拥有所有视图控制器视图的背景图像。 我正在使用这样的实现
func setNavigationAppearance(tintColor : UIColor, barTintColor : UIColor?) {
let navigationBarAppearace = appDelegateObj.navigationController!.navigationBar
navigationBarAppearace.tintColor = tintColor
navigationBarAppearace.barTintColor = barTintColor
navigationBarAppearace.translucent = false
//navigationBarAppearace.
//Settign the Custome Font and TextColor
if let font = UIFont(name: FontCustom.Regular, size: 17) {
UINavigationBar.appearance().titleTextAttributes = [NSFontAttributeName: font ,NSForegroundColorAttributeName : tintColor]
}
}
我用这张图片调用这个方法 让 navigationColor : UIColor = UIColor(patternImage: UIImage(named: AppImagesName.PatternRed)!)
我正在获取这些崩溃日志。
由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“在这种情况下仅支持 RGBA 或白色空间
我在谷歌上搜索过,所有人都说删除背景图片或者这是 iOS 错误。
所以请告诉我可能的解决方案。
【问题讨论】:
-
设置导航栏背景图片的代码在哪里?
-
@SathiReddy 我已经更新了这个问题。请看一看。
-
我正在处理您的问题...
-
我添加了代码..请检查..现在我正在将示例项目上传到 GitHub 并提供测试链接..
标签: ios swift uinavigationcontroller uinavigationbar