av一区二区在线观看_亚洲男人的天堂网站_日韩亚洲视频_在线成人免费_欧美日韩精品免费观看视频_久草视

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

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

瀏覽:171日期:2024-04-12 15:22:43

問題描述

- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { 請(qǐng)問這里的 webView.URL 和 navigationAction.request.URL 有什么區(qū)別? }- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler {請(qǐng)問這里的 webView.URL 和 navigationAction.request.URL 有什么區(qū)別?}

問題:1.上面代碼塊里面的問題 webView.URL 和 navigationAction.request.URL 有什么區(qū)別?2.當(dāng)我第一次加載一個(gè)網(wǎng)頁的時(shí)候,上面的代理方法為什么會(huì)被調(diào)用多次?3.如果我想攔截網(wǎng)頁的跳轉(zhuǎn)鏈接,希望通過 push 打開一個(gè)頁面重新展示一個(gè) webview,最好是在哪個(gè)代理方法里攔截? 遇到重定向問題怎么破?

問題解答

回答1:

調(diào)多次 是不是因?yàn)閡rl有重定向

回答2:

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

/*! @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)文章:
主站蜘蛛池模板: 亚洲国产精品suv | 第一福利视频 | 成人在线免费网站 | 国产精品久久久久久久久久 | 国产精品99久久久久久www | 开心激情婷婷 | 91精品国产99久久久久久红楼 | 天天色天天干天天 | 日韩免费视频一区二区 | 午夜影视剧场 | 欧美激情一区二区三区 | 亚洲精品www久久久久久广东 | www.三级 | 成人免费视频视频 | 亚洲av毛片 | 午夜天堂在线 | 99热最新| 亚洲欧美视频一区 | 午夜专区| 日韩成人小视频 | 91精品国产一区二区三区 | 五月天黄色网址 | 天天插天天操 | 国产亚洲欧美日韩高清 | 日韩黄色片 | 亚洲三级视频在线观看 | 国产视频一 | 久久爱综合 | 欧美在线免费观看视频 | 成年免费视频黄网站在线观看 | 日韩免费观看 | 中国免费av | 亚洲区一区二 | 久久免费视频观看 | 四虎成人影视 | 色综合天天综合网天天狠天天 | 日韩成人综合 | 少妇xxxx69| 亚洲国产伦理 | 国产又粗又猛又爽又黄 | 亚洲日本一区二区 |