How to stop loading the UIWebView

前端 未结 3 1746
被撕碎了的回忆
被撕碎了的回忆 2021-01-18 10:11

I created number of UIWebviews and add it to my view. And gave load request. I want to stop loading the uiwebview with tag=10. How can this implement?

3条回答
  •  醉话见心
    2021-01-18 10:26

    You can stop the UIWebView from loading in UIWebViewDelegate method:

    -(BOOL)webView:(UIWebView*)webView  shouldStartLoadingWithRequest:(NSURLRequest*)request navigationType:(UINavigationType)navigationType
    {
        if(webView.tag==10)
        {
            return  NO;
        }
        return YES;
    }
    

    It will Help you.

提交回复
热议问题