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

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

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

瀏覽:124日期: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;

標(biāo)簽: web
相關(guān)文章:
主站蜘蛛池模板: 久久机热一这里只精品 | 日韩黄色网 | 久久免费成人 | 秘书上班和老板啪啪中文字幕 | 日韩中文字幕久久久经典网 | 久久精品爱| 国产高清啪啪 | 午夜精品久久久久久99热7777 | 成年人免费影院 | 亚洲欧美一区二区三区二厂 | 欧美亚洲免费 | 免费一区二区三区四区五区 | 97久久精品午夜一区二区 | 国产一区二区视频在线 | 久久精品免费视频观看 | 不卡视频一区 | 亚洲精品一区二区三区四区五区 | 欧美综合亚洲图片综合区 | 一级黄色特级片 | 日韩精品在线一区二区 | 91手机在线视频观看 | 久草免费资源在线 | 91在线播放网站 | 综合色久 | 在线观看免费黄色 | 一级毛片成人免费看免费不卡 | 又亲又揉摸下面视频免费看 | 国产自精品在线 | 国产美女精品 | 日本久久网 | 黄色电影毛片 | x8x8国产在线观看2021 | 伊人久久精品线影院 | 亚洲一区二区三区高清 | 国产第一页视频 | 欧美日韩国产精品综合 | 99av在线播放| 中文字幕不卡免费视频 | xvideos视频国产chinese | 免费观看性行为的视频网站 | www.欧美黄色|