亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術(shù)文章
文章詳情頁

objective-c - iOS 開發(fā)中 WKWebView 的使用問題攔截跳轉(zhuǎn)

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

問題描述

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

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

問題解答

回答1:

調(diào)多次 是不是因為url有重定向

回答2:

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

/*! @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
相關(guān)文章:
主站蜘蛛池模板: 久久厕所精品国产精品亚洲 | 日本特黄特黄特刺激大片 | 亚洲欧洲精品视频在线观看 | 欧美一级一一特黄 | 亚洲日本韩国欧美 | 人操人摸| 国产九九精品视频 | 亚洲国产片 | 99视频在线观看高清 | 日本三级黄色网址 | 久草在线观看福利视频 | 欧美视频一二三区 | 国产精品久久在线观看 | 中国黄色录像 | 成人久久18免费网站入口 | 夜夜嘿视频免费看 | 国产黑人在线 | 国产无套在线观看视频 | 性色a v 一区 | 成人国产一区二区三区 | 美国黄色一级毛片 | 国产精品怕怕怕视频免费 | 亚洲一区二区三区夜色 | 婷婷色六月 | 亚洲欧美视频一区二区 | 一级做a爱过程视频免 | 国产黄视频在线观看 | 国产亚洲欧美日韩在线一区 | 久草福利资源 | 欧美在线一区二区三区欧美 | 午夜一区二区免费视频 | 一区二区精品在线观看 | 在线观看国产小屁孩cao大人 | 天天影视欧美综合在线观看 | 黄色免费网络 | 国产美女精品视频 | 久久91视频 | 伊人成伊人成综合网2222 | 国产1区2区在线观看 | 手机看片日韩国产福利视频 | 中文字幕日韩高清 |