Flash scroll indicators for UIWebView

The UIWebView doesn’t itself have the ability to flash scroll indicators, unlike a UITableView. It’s a nice UI queue that apply has supplied for letting a user know if there is more content than is visually available (because of course there are no native scrollbars in iOS).

I’ve been coding up an application that uses HTML pages to serve up some dynamic content styled with CSS, etc. and each time I load a different page into my UIWebView I perform some visual effects to show the change, but I couldn’t flash scroll indicators to show the user that there might be more information available on a flick. After Googling a lot, I finally found this little bit of code that works nicely.

UIScrollView *scrollView = [contentWebView.subviews objectAtIndex:0];
[yourScrollView flashScrollIndicators];

That’s it. Enjoy :)

Related Posts Plugin for WordPress, Blogger...

One thought on “Flash scroll indicators for UIWebView

  1. Azeem Shaikh

    Starting iOS 5.0 onwards, a better way to achieve this would be

    [webView.scrollView flashScrollIndicators];

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *


2 − two =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>