I'm new to Xamarin, so hopefully this is an easy fix. The problem is simple: I have a ScrollView containing a StackLayout, and adding new children to the StackLayout briefly causes the existing children to squish together causing a jittery visual disturbance. In the application I'm writing, children are being added to the StackLayout as the user scrolls down, so this jitter is also causing some more complicated issues with my scroll events.
The isolated issue is easy to reproduce:
<ScrollView>
<StackLayout>
<Button Clicked="Button_Clicked" Text="Click Me" HeightRequest="80"/>
<StackLayout x:Name="Column1"/>
</StackLayout>
</ScrollView>
private void Button_Clicked(object sender, EventArgs e)
{
for (int i = 0; i < 5; i++)
Column1.Children.Add(new Frame() { BackgroundColor = Xamarin.Forms.Color.Blue, HeightRequest = 100 });
}
Is there any way to create a scrollable view and add content dynamically without disrupting existing content? Any help would be much appreciated!