iOS WKWebView页面内无法跳转问题

首先遵循WKNavigationDelegate协议,并实现以下方法即可

- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
    
//    NSURL* scheme = [navigationAction.request URL];
//    MyLog(@"请求URL:%@", scheme);
    if (navigationAction.targetFrame == nil) {
        [webView loadRequest:navigationAction.request];
    }
    
    decisionHandler(WKNavigationActionPolicyAllow);
}

你可能感兴趣的:(iOS WKWebView页面内无法跳转问题)