Change tintcolor of SFSafariViewController?

被刻印的时光 ゝ 提交于 2019-12-05 10:25:10

问题


As the title says; how does one change the overall tint color of the new, in iOS 9, SFSafariViewController?


回答1:


Some news from iOS 10: now we have two properties to control the overall looks of the SFSafariViewController

source: link

The only downside is, of course, it's not available for older versions.

if #available(iOS 10.0, *) {
    safariVC.preferredBarTintColor = .black
    safariVC.preferredControlTintColor = .white
} else {
    safariVC.view.tintColor = .someColor
}



回答2:


It's a property of the view, safariVC.view.tintColor = UIColor.someColor()




回答3:


There's no need for that.

Just use CSafariWebKit and set the Color you want in BarTintColor and the TintColor:

So, you won't need to check if it's available. The frameworks does it for you

let vc = SafariViewController(url: url, barTintColor: nil, tintColor: nil)
vc.presentSafari(fromViewController: self, whenDidFinish: nil)


来源:https://stackoverflow.com/questions/31913683/change-tintcolor-of-sfsafariviewcontroller

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!