0

I have add html file to load inside UIWebview and its working fine. Then (UIWebview) scrolling faster delay to load text, its appear white background while scrolling faster. I want to remove the white background while scrolling faster.

Is it possible to load UIActivityIndicatorView at the timw, please hlep me

Thanks in Advance

SampathKumar
  • 2,525
  • 8
  • 47
  • 82

2 Answers2

0

Because event tracking in UIScrollview blocks the main thread.

You can try to force scrollView end scrolling(or decelerating) before another web action.

I played with your original solution a bit, and this seems to work just fine. I think you almost had it, but you were just offsetting the rect that you used too much, and forgot that you could just scroll the rect straight back to the original rect.

The generalized solution for any scrolling action is this:

 - (void)killScroll 
    {
        CGPoint offset = scrollView.contentOffset;
        offset.x -= 1.0;
        offset.y -= 1.0;
        [scrollView setContentOffset:offset animated:NO];
        offset.x += 1.0;
        offset.y += 1.0;
        [scrollView setContentOffset:offset animated:NO];

}

[Edit] As of iOS 4.3 (and possibly earlier) this also appears to work

- (void)killScroll 
{
    CGPoint offset = scrollView.contentOffset;
    [scrollView setContentOffset:offset animated:NO];
}
karthika
  • 4,085
  • 3
  • 21
  • 23
Vizllx
  • 9,135
  • 1
  • 41
  • 79
0

I think I found the problem. It looks like NSURLRequestReturnCacheDataElseLoad and NSURLRequestReturnCacheDataDontLoad is broken on the iPhone. When a NSCachedURLResponse is returned from the cache and it contains HTTP headers indicating that the content has expired (e.g. Expires, Cache-Control etc), the cached response is ignored and the request is made to the original source.

The solution is as follows:

Implement your own subclass of NSHTTPURLResponse which allows you to modify the allHeaderFields dictionary. Implement your own NSURLCache, override cachedResponseForRequest: and return a new NSCachedURLResponse containing an instance of your NSHTTPURLResponse subclass with the relevant "expiry" HTTP headers stripped.

Vizllx
  • 9,135
  • 1
  • 41
  • 79