我在更改导航栏的背景颜色时遇到问题MFMessageComposeViewController.
我试过这段代码:
UINavigationBar.appearance().barTintColor = Configuration.Colors.navigationBarBackgroundColor
UINavigationBar.appearance().backgroundColor = UIColor.green
UINavigationBar.appearance().titleTextAttributes = [NSFontAttributeName: UIFont(name: "Roboto-Regular", size: 18)!, NSForegroundColorAttributeName: UIColor.white] as [String: AnyObject]
let composer = MFMessageComposeViewController()
self?.present(composer, animated: true) {
UIApplication.shared.statusBarStyle = .lightContent
}
Run Code Online (Sandbox Code Playgroud)
这不起作用.最奇怪的是,当我做同样的事情时,它确实有效MFMailComposeViewController.
我也尝试直接在作曲家上改变颜色.
composer.navigationBar.tintColor = Configuration.Colors.navigationBarBackgroundColor
Run Code Online (Sandbox Code Playgroud) 在 Android Gradle 插件版本 4.1.0 中,它们发生了变化,因此断言现在总是在调试版本中抛出。如何禁用此功能?
调试版本中的断言
当您使用 Android Gradle 插件 4.1.0 及更高版本构建应用程序的调试版本时,内置编译器 (D8) 将重写应用程序的代码以在编译时启用断言,因此您始终使断言检查处于活动状态。