M
M
mix20002014-07-02 10:00:52
iOS
mix2000, 2014-07-02 10:00:52

Why is there a delay when displaying content in a UIWebView?

There is a WebView located on one of the screens in the storyboard, in this WebView, when you go to the page, a local html page is loaded (via NSURLRequest). In some cases (always at the first launch after installing the application and at startup after a long period of inactivity of the application), there is a delay before the html page is displayed. That is, at first a white screen is shown, and only after 1-2 seconds the content is displayed. After that, all pages in the application are displayed quickly, without delay.
The html page itself is nothing special, a few kilobytes of text and several styles connected via external css.
What could be the reason for this delay? How to eliminate?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Hitory, 2014-07-10
@Hitory

I came across this moment - it turned out that webview initializes some internal caches and styles at startup. Therefore, the first download takes ~1sec.
I made an alpha animation when loading the page so that the user is not annoyed by the window that suddenly appears.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question