国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

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

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

瀏覽:123日期: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
相關文章:
主站蜘蛛池模板: 国产成人综合亚洲亚洲欧美 | 亚洲精品国产专区91在线 | 女人张开双腿让男人 | 久久精品国产欧美成人 | 久久精品免费视频观看 | 亚洲国产精品一区二区九九 | 综合久久久久久中文字幕 | 免费在线观看a级片 | 一级特色大黄美女播放网站 | 午夜性刺激免费视频观看不卡专区 | 日韩精品不卡 | 好男人天堂网 | 国产欧美一区二区三区在线 | 久久欧美成人精品丝袜 | 欧美一区二区三区国产精品 | 亚洲精品久久片久久 | 精品国产高清a毛片 | 91福利国产在线观一区二区 | 国产精品白浆流出视频 | 国产呦精品系列在线 | 中国美女黄色一级片 | 牛人盗摄一区二区三区视频 | 日本αv | 亚洲成年网站在线观看 | 国产美女拍拍拍在线观看 | 亚欧视频在线观看 | 免费a级毛片无码 | 狠狠色狠狠色狠狠五月ady | 成年人视频网站免费 | 美女很黄很黄免费 | 久草免费在线播放 | 偷拍第1页 | 在线精品日韩一区二区三区 | 丰满老熟女毛片 | 伊人色综合久久天天人手人停 | 五月天激激婷婷大综合蜜芽 | 免费观看成人毛片 | 美国三级毛片 | 毛片日韩 | 国产a级特黄的片子视频免费 | 午夜神马理论 |