Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Is it possible to wait for content to be rendered before attempting a ScrollView scroll?

$
0
0

Hi,

Within a ContentPage (after it's been displayed), I'd like to have a user action generate a ScrollView (on the same page), add controls to it (via a vertically-oriented StackLayout), and then immediately scroll to a specific control that the user had selected. Ideally, the scroll would occur just before the user interacts with the ScrollView.

My plan is to locate the control among the StackLayout children in order to obtain the Y position. Then I use that to scroll the ScrollView. This works fine if I scroll from an already created ScrollView with controls.

The problem I'm running into is that now I attempt the scroll after my 'DrawLayout' method is executed, but apparently before the controls are rendered (ie. their y positions are still 0). Is there a way to wait on the rendering of the ScrollView's content after dynamically creating it?

Thanks!


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>