UIWebView is whistling with difficulty

I need to use the web site with a fairly small amount of content in my application through UIWebView.

When I browse a page in Mobile Safari, everything scrolls smoothly. Even if I scroll quickly, a gray square of the background appears, but appears after a few seconds (less than 0.5 seconds).

On the same page UIWebView, it scrolls if it scrolls quickly and the gray square of the background is not displayed. I assume that Mobile Safari first displays the gray square of the background and does after that, but UIWebViewstops scrolling until the displayed part is displayed.

How do I say UIWebViewto act like Mobile Safari?

+1
source share
2 answers

It is already drawn on its own custom tiledLayer. The problem is that by default it tries to draw itself on the main thread, so it blocks when I cannot draw. There is a private message that you can call

-(void)_setDrawInWebThread:(BOOL)arg1

This will work, but you will see an empty space when you scroll too fast and cannot keep up with the pattern until you have time to catch up. They use:

-(void)_setDrawsCheckededPattern:(BOOL)arg1

in a mobile safari to help with this.

+3
source

Source: https://habr.com/ru/post/1749766/


All Articles