亚洲免费在线视频-亚洲啊v-久久免费精品视频-国产精品va-看片地址-成人在线视频网

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

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

瀏覽:170日期: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
相關文章:
主站蜘蛛池模板: 国产一区亚洲欧美成人 | 欧美视频三级 | 一区二区视频在线 | 国产女女视屏免费 | 亚洲第一黄色网 | 亚洲精品在线免费看 | 久久综合婷婷香五月 | 精品国产高清在线看国产 | 日韩久久中文字幕 | 亚洲欧洲视频在线 | 在线视频一二三区 | 国产精品美乳免费看 | 插美女网站 | 国产亚洲欧美日韩在线观看一区二区 | 国产特级全黄一级毛片不卡 | 久久久亚洲欧洲日产国码二区 | 国产在线一区二区三区四区 | 色老头老太做爰视频在线观看 | cao在线| 免费一级做a爰片性色毛片 免费一极毛片 | 成年人黄色免费网站 | 欧美日韩视频在线 | 精品国产高清不卡毛片 | 国产网站在线 | 亚洲天堂成人在线观看 | 模特视频一二三区 | 在线观看亚洲天堂 | 欧美精品亚洲精品日韩 | 韩国美女爽快一毛片免费 | 99视频只有精品 | 欧美成人午夜毛片免费影院 | 男人都懂的网址在线看片 | 成年女人aaaaa毛片 | 欧美一级毛片兔费播放 | 久久久91精品国产一区二区 | 亚洲国产精品一区二区久 | 国产成人精品免费视频网页大全 | 欧美精品片 | 手机国产日韩高清免费看片 | 日本高清色视频www 日本高清在线精品一区二区三区 | 日韩欧美印度一级毛片 |