午夜剧场伦理_日本一道高清_国产又黄又硬_91黄色网战_女同久久另类69精品国产_妹妹的朋友在线

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

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

瀏覽:240日期: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.當我第一次加載一個網(wǎng)頁的時候,上面的代理方法為什么會被調用多次?3.如果我想攔截網(wǎng)頁的跳轉鏈接,希望通過 push 打開一個頁面重新展示一個 webview,最好是在哪個代理方法里攔截? 遇到重定向問題怎么破?

問題解答

回答1:

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

回答2:

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

/*! @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
相關文章:
主站蜘蛛池模板: 久久国产成人精品av | 热久久免费视频 | 久久成人精品 | 日韩v | www.日韩一区 | 99热在线只有精品 | 日韩在线观看不卡 | 在线观看欧美日韩视频 | 三级视频久久 | 日韩av综合| 国产精品久久国产精品 | 国产精品99久久久久久动医院 | 国产精品最新 | 一级精品视频 | 看黄网站在线观看 | 四虎影视在线观看 | 福利精品| 丁香六月av | 欧洲做受高潮免费看 | 啪啪免费网 | 国产精品揄拍500视频 | 欧美xxxx中国 | 在线观看国产欧美 | 久久精品福利视频 | 成人在线观看网址 | 国产做受高潮 | 欧美性v | 国产精品成av人在线视午夜片 | 亚洲欧美日本在线观看 | 亚洲vs天堂 | 午夜视频网站 | 亚洲精品日韩欧美 | 日本男人的天堂 | 日韩综合在线观看 | 一区二区三区免费视频观看 | av激情网 | 激情综合五月婷婷 | 肢体的诱惑在线观看 | 久草福利在线观看 | 天堂va蜜桃一区二区三区 | 欧美黄色一级网站 |