How to determine iFrame finished loading in UIWebView

前端 未结 3 1474
日久生厌
日久生厌 2021-02-06 08:06

In my app, I need a way to tell when my webview is finished loading. It is very easy to do that if content is html. However, my content source is javascript with iFrame inside,

3条回答
  •  醉梦人生
    2021-02-06 08:57

    To tell if a webview is loading, you can use webView.isLoading to check if all the frames of a webview are done loading. No counting the number of iframes necessary. Simply check if isLoading is true inside webViewDidFinishLoad:

    http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html

提交回复
热议问题