How to achieve scrolling on a page with StackLayout and WebView? RRS feed

  • Question

  • User29927 posted

    Currently I have the following project: https://github.com/bencrispin/ScrollInWeb I know I've read in other forum posts that a scrollable view inside of another is skeptical, but this works consistently in the above project when rotating from portrait to landscape. So, I'm think there is a way to update the ScrollView after the ViewModel Command completes or it's child (StackLayout) size changes. Any direction on this is appreciated. Thanks!

    Friday, July 31, 2015 6:01 PM

All replies

  • User12878 posted

    Hi Matt,

    Short forewarning, no, at least not what I've found.

    The second forewarning is that maybe someone else knows how to :)

    For starters.. I wouldn't know how a scrollview could know it's content when it's content is a scrollable webview.

    Also, you say that this works consistently when you rotate to landscape and back, but I find that on an emulator and on device (HTC One M7) whilst the scrollview does work as perhaps you'd expect, the webview height is actually cut short and doesn't display the entire content. Can you confirm this?

    Additionally.. none of the below will satisfy your issue but..

    The grid references should be zero based, they're 1 based in the example.

    There's seemingly no need for the outer stacklayout.

    Not sure why the second column button is in a stacklayout. Use ContentView for padding.

    A nested grid would probably work best, if you're into grids that is :)

    All that said, it's almost probable to do with a custom renderer but you're looking to resize complex parent containers when the child has finally received it's own content - whenever that may be, so that brings about the other problem on which platforms this is for, and, I don't think this is a wise idea either way aaaand I'd rethink this idea perhaps, scrolling within scrolling is always a nightmare :)

    Cheers, Jode

    Saturday, August 1, 2015 12:53 AM
  • User29927 posted

    Hi Jode, Not rotating from landscape and back, but rotating from portrait and staying in landscape the scrollview works consistently. Portrait is intermittent, but not on load. I just roughed this together; pulled it from a larger project. Thanks for the pointers. My end goal is to get more screen real estate for the content of the webview. I'm able to hide the grid view with a label click, but I think a single scrolling view is more user friendly.

    Thanks again.

    Saturday, August 1, 2015 2:50 AM
  • User387032 posted

    Did you managed to make this works? Could you please share how?

    Thursday, October 17, 2019 11:12 AM
  • User89714 posted

    @wagenheimer said: Did you managed to make this works? Could you please share how?

    The forum rules and guidelines at https://forums.xamarin.com/discussion/87290/xamarin-forum-rules-and-guidelines#latest say:

    "Successful Contributors Will Not:" ... "Comment on old posts: It's preferred to post a new question/discussion and include a link if there is relevant information you want to share when a topic is older than 6 months. There are some exceptions to this rule when an ongoing conversation is active on a long thread."

    Also, if you look at the profiles for the previous posters on this thread, you will see that @MattSkepner was Last Active December 2015, and @JodeAndrews was Last Active November 2016, so it's very unlikely that either will answer.

    I suggest that you start a new thread with a more specific question (i.e. including your XAML/C# if you already have some relevant to the question).

    Thursday, October 17, 2019 11:40 AM