【问题标题】:AVPlayer Subtitle selection screen's Done button is always in white colorAVPlayer 字幕选择屏幕的完成按钮始终为白色
【发布时间】:2021-04-30 19:37:01
【问题描述】:

我们的app导航栏是白色的,它是push一个viewcontroller在WKWebview中加载一些html内容,内容页面有一些视频。在点击视频时,WKWebview 会启动视频播放器。

在这种情况下,用户尝试更改字幕,字幕导航栏背景颜色与父级一样为白色,并且此屏幕中的完成按钮也变为白色(变得不可见)。

 UINavigationBar.appearance().barTintColor = .green
 UINavigationBar.appearance().tintColor = .red
 UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.yellow]
 UINavigationBar.appearance().isTranslucent = false

此主题应用于导航控制器,而不是音频和字幕屏幕右侧的完成按钮。

有什么办法可以解决这个问题吗?

Screenshot1 ScreenShot2

【问题讨论】:

    标签: swift uinavigationcontroller uinavigationbar wkwebview avplayer


    【解决方案1】:

    很多人提到,UINavigationBar.appearance().barTintColor 也可以改变导航项的颜色。

    但是下面的代码帮助我改变了完成按钮的颜色

    UIBarButtonItem.appearance().tintColor = .green
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-18
      • 2018-10-21
      • 2016-02-03
      • 1970-01-01
      • 1970-01-01
      • 2018-12-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多