色综合图-色综合图片-色综合图片二区150p-色综合图区-玖玖国产精品视频-玖玖香蕉视频

您的位置:首頁技術文章
文章詳情頁

objective-c - iOS 開發中 WKWebView 的使用問題攔截跳轉

瀏覽:154日期:2024-04-12 15:22:43

問題描述

- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { 請問這里的 webView.URL 和 navigationAction.request.URL 有什么區別? }- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler {請問這里的 webView.URL 和 navigationAction.request.URL 有什么區別?}

問題:1.上面代碼塊里面的問題 webView.URL 和 navigationAction.request.URL 有什么區別?2.當我第一次加載一個網頁的時候,上面的代理方法為什么會被調用多次?3.如果我想攔截網頁的跳轉鏈接,希望通過 push 打開一個頁面重新展示一個 webview,最好是在哪個代理方法里攔截? 遇到重定向問題怎么破?

問題解答

回答1:

調多次 是不是因為url有重定向

回答2:

你可以打印出來看看他們的值,看看跳轉網頁的時候是在哪里打印的。文檔里有關于這兩個代理的說明。

/*! @abstract Decides whether to allow or cancel a navigation. @param webView The web view invoking the delegate method. @param navigationAction Descriptive information about the action triggering the navigation request. @param decisionHandler The decision handler to call to allow or cancel the navigation. The argument is one of the constants of the enumerated type WKNavigationActionPolicy. @discussion If you do not implement this method, the web view will load the request or, if appropriate, forward it to another application. */- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler;/*! @abstract Decides whether to allow or cancel a navigation after its response is known. @param webView The web view invoking the delegate method. @param navigationResponse Descriptive information about the navigation response. @param decisionHandler The decision handler to call to allow or cancel the navigation. The argument is one of the constants of the enumerated type WKNavigationResponsePolicy. @discussion If you do not implement this method, the web view will allow the response, if the web view can show it. */- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler;

標簽: web
相關文章:
主站蜘蛛池模板: 免费观看a视频 | 国产成人精品日本亚洲语音2 | 伊人365影院 | 91精品免费久久久久久久久 | 99久久精品国产综合一区 | 久久一区二区三区免费 | 91亚洲国产成人久久精品网站 | 青草青99久久99九九99九九九 | 狠狠色综合久久丁香婷婷 | 亚洲天堂免费在线视频 | 一级片久久| 日本午夜vr影院新入口 | 欧美综合精品一区二区三区 | 香蕉久久夜色精品国产2020 | 国产免费一级在线观看 | 中文字幕一区二区在线视频 | 欧美精品高清在线观看 | 一级淫片免费视频 | 男女视频免费在线观看 | 欧美一级网址 | 波多野结衣视频免费 | 国产在线欧美日韩一区二区 | 欧美日韩 在线播放 | 国产精品日产三级在线观看 | 日本特级淫片免费看 | 免费久久精品 | 精品自拍视频 | 91年精品国产福利线观看久久 | 国内精品美女写真视频 | 超91在线 | 国产精品96久久久久久久 | 国产原创自拍 | 久久一本一区二区三区 | 国产精品毛片久久久久久久 | 亚洲网站在线播放 | 亚洲欧美视频在线播放 | 国产成人一级片 | 亚洲 欧美 成人日韩 | 日韩精品福利视频一区二区三区 | 国产精品大全国产精品 | 欧美真人毛片动作视频 |