Tapping Status bar to scroll to top in UIWebView, how?

Discussion in 'iOS Programming' started by Compile 'em all, Jul 24, 2009.

  1. Compile 'em all macrumors 601

    Compile 'em all

    Joined:
    Apr 6, 2005
    #1
    I think I have already summarized my question in the thread's subject :D. Basically my app has a UIWebView but tapping the status bar doesn't scroll back to the top unlike in Mobile Safari. Is there a certain method I need to override or property a need to set to get such behavior?

    thanks!
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    This is controlled by the UIWebView scrollsToTop property. Check the docs on that.
     
  3. Compile 'em all thread starter macrumors 601

    Compile 'em all

    Joined:
    Apr 6, 2005
  4. Compile 'em all thread starter macrumors 601

    Compile 'em all

    Joined:
    Apr 6, 2005
    #4
    scrollsToTop is a property of UIScrollView not UIWebView :eek:
     
  5. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #5
    Yes, that's what I meant. This is controlled by the UIScrollView scrollsToTop property. Did you read the docs for that? Is this working for you or not? Although UIWebView doesn't inherit from UIScrollView it has one or hosts one. I know that it's not exposed but are you doing something that would prevent the webview's scrollview from supporting the scrollsToTop property?

    FWIW, I have a simple web view in my app to display some simple text and it scrolls to the top.
     
  6. Compile 'em all thread starter macrumors 601

    Compile 'em all

    Joined:
    Apr 6, 2005
    #6
    It is not working for me because I can't see how can I set said property. UIWebView doesn't have a UIScrollView. I have checked the docs.

    edit: im not doing anything special. The UIWebView just loads a URL, and for all sites I tried it never scrolls to the top when tapping the status bar.
     

Share This Page