ios - 更改导航栏和取消 google cast 视图的按钮
问题描述
我已经在我的项目中实现了 google cast 框架并开始对 google cast 视图进行主题化。
目前我有这段代码:
let castStyle = GCKUIStyle.sharedInstance()
//DeviceChooser
castStyle.castViews.deviceControl.deviceChooser.backgroundColor = theme.googleCastDeviceChooserBackgroundColor
castStyle.castViews.deviceControl.deviceChooser.iconTintColor = theme.googleCastDeviceChooserIconTintColor
castStyle.castViews.deviceControl.deviceChooser.headingTextColor = theme.googleCastDeviceChooserHeadingTextColor
castStyle.castViews.deviceControl.deviceChooser.captionTextColor = theme.googleCastDeviceChooserCaptionTextColor
castStyle.castViews.deviceControl.deviceChooser.headingTextFont = theme.googleCastDeviceChooserHeadingTextFont
castStyle.castViews.deviceControl.deviceChooser.captionTextFont = theme.googleCastDeviceChooserCaptionTextFont
UINavigationBar.appearance().barTintColor = theme.googleCastNavigationBarBackgroundColor
UINavigationBar.appearance().isTranslucent = false
UINavigationBar.appearance().tintColor = UIColor.red
UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor: theme.googleCastNavigationBarIconTintColor]
UIBarButtonItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.green], for: .normal)
UIBarButtonItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.red], for: .selected)
castStyle.apply()
我仍然对设备选择器的样式有一些问题:
导航栏取消按钮的颜色没有变化 --> 导航栏的背景颜色确实更改为正确的颜色。
似乎没有找到一种方法来设置表格视图的分隔符颜色。