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

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

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

瀏覽:114日期: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
相關文章:
主站蜘蛛池模板: 一级特级欧美a毛片免费 | 不卡一级毛片免费高清 | 真正国产乱子伦高清对白 | 久久成人18 | 日本爽快片100色毛片 | 精品国产一区二区三区免费看 | 99在线视频免费 | 久久久综合结合狠狠狠97色 | 99国产精品免费观看视频 | 国产精品二区页在线播放 | 久久99热只有视精品6国产 | 成人在线网站 | 久久成人性色生活片 | 亚洲国产成人九九综合 | 欧美猛交xxxx免费看 | 亚洲国产国产综合一区首页 | 91精品国产91久久久久久 | 久久中文字幕免费视频 | 亚洲一区二区三区免费在线观看 | 亚洲高清国产一区二区三区 | 色午夜在线 | 亚洲欧美日韩在线不卡中文 | 国产午夜精品久久理论片小说 | 伊人99re| 久久久久久久久久久久久久久久久久 | 日韩午夜三级 | 国产精品在线播放 | 在线看a级片| 日韩欧美视频一区二区在线观看 | 亚洲视频播放 | 曰本aaaaa毛片午夜网站 | 日韩欧美在 | 久草视频在线免费 | 丝袜美腿精品一区二区三 | 女人张开腿让男人捅的视频 | 欧美视频一区二区三区在线观看 | 性感美女一级片 | 牛牛本精品99久久精品88m | 国内成人精品视频 | 上海一级毛片 | 日韩一区二区天海翼 |