QLPreviewController的tintColor第一次打开是不同的

问题描述 投票:0回答:1

每当我调出QLPreviewController时,tintColor默认为粉红色。我希望它是一种特定的颜色,所以我将其设置为[]

UINavigationBar.appearance().tintColor = UIColor.hexStringToUIColor(hexStr: "202020")

这是调出QLPreviewController的方法的样子

func openQLPreview() {
    quickLookController = QLPreviewController()
    UINavigationBar.appearance().tintColor = UIColor.hexStringToUIColor(hexStr: "202020")
    quickLookController.dataSource = self
    self.navigationController?.pushViewController(self.quickLookController, animated: true)
}

This is what it looks like the first time (after installing or closing and re-opening I open a document using the QLPreviewController

And this is what it looks like when I tap the back arrow and open the same document or any other document

无论我是否是第一次调用QLPreviewController,我都希望它始终是第二种颜色。每当应用终止并重新启动时,它就会切换回粉红色。

每当我调出QLPreviewController时,tintColor默认为粉红色。我希望它是一种特定的颜色,所以我将其设置为UINavigationBar.appearance()。tintColor = UIColor ....

ios swift user-interface uinavigationbar qlpreviewcontroller
1个回答
0
投票

尝试一下

© www.soinside.com 2019 - 2024. All rights reserved.