在 WKWebView 中,每次点击 URL 时,navigationType
都是 .other
。 navigationType
何时等于 .linkActivated
?
不太可能。也许您对原始值的解释有误?
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
print(navigationAction.navigationType.rawValue)
// -1 "other" seen when assigning the url programatically
// 0 "linkActivated" a link with an href attribute was tapped
// 3 "reload" page was refreshed
}
见 the docs您可以在其中单击列出的枚举并查看它们的原始值
关于ios - 什么时候navigationAction.navigationType == .linkActivated?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46548202/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |