ios wkwebview打开target新页面
ios wkwebview打开页面以后,附件word文档,或者jpg地址,打开target新页面,做下拦截判断-(void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigation
·
ios wkwebview打开页面以后,附件word文档,或者jpg地址,打开target新页面,做下拦截判断
-(void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
{
//如果是跳转一个新页面
if (navigationAction.targetFrame == nil) {
[webView loadRequest:navigationAction.request];
}
decisionHandler(WKNavigationActionPolicyAllow);
}
更多推荐
已为社区贡献1条内容
所有评论(0)