title: Xamarin.Forms ScrollView ScrollToAsync() results in blank content on iOS
body: <p><strong>Background</strong>
  We have a page where we have a bound RepeaterView within a ScrollView. We're adding Questions to the bound collection as the user answers questions (the aim is to give a series of questions, scrolling off the top as the user progresses).</p>
  
  <p>We want the ScrollView to scroll to the bottom as we add Questions.</p>
  
  <p>To do this, I've created an Event which we raise when we add a Question, and added a handler in the Page. I'm subscribing/unsubscribing on the Appearing/Disappearing events for the page to avoid memory leaks etc.</p>
  
  <p><strong>The Problem</strong>
  On Android this works fine. But on iOS, the ScrollView goes blank. <em>However</em>, if I background the app and bring it back to the foreground (by tapping the Home button and then the app icon, the screen then refreshes.</p>
  
  <p>Therefore it appears that the Page isn't being refreshed properly by my code.</p>
  
  <p>My XAML code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Threading.Tasks;
  using MvvmCross.Forms.Presenters.Attributes;
  using MyApp.Mobile.PageModels.Claims.Medical;
  using MyApp.Mobile.Pages.Base;
  using Xamarin.Forms;
  
  namespace MyApp.Mobile.Pages.Claims.Medical
  {
      [MvxContentPagePresentation(NoHistory = true)]
      public partial class ClaimConditionPage : BaseContentPage&lt;ClaimConditionPageModel&gt;
      {
          public ClaimConditionPage()
          {
              InitializeComponent();
          }
  
          protected override void OnAppearing()
          {
              if (BindingContext != null)
              {
                  ClaimConditionPageModel model = (ClaimConditionPageModel)this.BindingContext.DataContext;
  
                  model.QuestionAdded += Model_QuestionAdded;
              }
  
              base.OnAppearing();
          }
  
          protected override void OnDisappearing()
          {
              ClaimConditionPageModel model = (ClaimConditionPageModel)this.BindingContext.DataContext;
  
              model.QuestionAdded -= Model_QuestionAdded;
              base.OnDisappearing();
          }
  
          void Model_QuestionAdded(object sender, EventArgs e)
          {
              Device.BeginInvokeOnMainThread(async () =&gt;
              {
                  await QuestionScrollView.ScrollToAsync(0, QuestionScrollView.Content.Height, false);
              });
  
          }
  
      }
  }
  </code></pre>
  
  <p>I've seen suggestions of adding a Task.Delay() to allow the UI to catch up - but this didn't work.</p>
  
  <p><em>Note</em> that this is only on iOS.</p>
  
  <p>I note that there is <a href="https://github.com/xamarin/Xamarin.Forms/issues/2271#issue-311415190" rel="nofollow noreferrer" title="this bug">this bug</a>, but I don't think this is my problem. The ScrollView does scroll, but the display goes blank.</p>
  
  <p><strong>Versions</strong>
  Xamarin.Forms 3.4.0.1029999</p>
  
  <p>=== Visual Studio Community 2017 for Mac ===</p>
  
  <p>Version 7.8.2 (build 1)
  Installation UUID: 650b4c91-c7f5-4ee5-ad70-6f178f314906
      GTK+ 2.24.23 (Raleigh theme)
      Xamarin.Mac 5.0.0.0 ( / b40230c0)</p>
  
  <pre><code>Package version: 516000221
  </code></pre>
  
  <p>=== Mono Framework MDK ===</p>
  
  <p>Runtime:
      Mono 5.16.0.221 (2018-06/b63e5378e38) (64-bit)
      Package version: 516000221</p>
  
  <p>=== NuGet ===</p>
  
  <p>Version: 4.8.0.5385</p>
  
  <p>=== .NET Core ===</p>
  
  <p>Runtime: /usr/local/share/dotnet/dotnet
  Runtime Versions:
      2.1.8
      2.1.5
      2.1.2
      2.1.1
      2.0.5
  SDK: /usr/local/share/dotnet/sdk/2.1.504/Sdks
  SDK Versions:
      2.1.504
      2.1.403
      2.1.302
      2.1.301
      2.1.4
  MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Sdks</p>
  
  <p>=== Xamarin.Profiler ===</p>
  
  <p>Version: 1.6.4
  Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler</p>
  
  <p>=== Updater ===</p>
  
  <p>Version: 11</p>
  
  <p>=== Apple Developer Tools ===</p>
  
  <p>Xcode 10.1 (14460.46)
  Build 10B61</p>
  
  <p>=== Xamarin.Mac ===</p>
  
  <p>Version: 5.2.1.15 (Visual Studio Community)
  Hash: d60abd198
  Branch: 
  Build date: 2019-02-01 12:23:30-0500</p>
  
  <p>=== Xamarin.iOS ===</p>
  
  <p>Version: 12.2.1.15 (Visual Studio Community)
  Hash: d60abd198
  Branch: d15-9
  Build date: 2019-02-01 12:23:29-0500</p>
  
  <p>=== Xamarin.Android ===</p>
  
  <p>Version: 9.1.8.0 (Visual Studio Community)
  Android SDK: /Users/jameslavery/Library/Developer/Xamarin/android-sdk-macosx
      Supported Android versions:
          2.3   (API level 10)
          4.0.3 (API level 15)
          4.1   (API level 16)
          4.3   (API level 18)
          4.4   (API level 19)
          5.0   (API level 21)
          5.1   (API level 22)
          6.0   (API level 23)
          7.0   (API level 24)
          7.1   (API level 25)
          8.0   (API level 26)
          8.1   (API level 27)</p>
  
  <p>SDK Tools Version: 26.1.1
  SDK Platform Tools Version: 28.0.0
  SDK Build Tools Version: 26.0.2</p>
  
  <p>=== Microsoft Mobile OpenJDK ===</p>
  
  <p>Java SDK: /Users/jameslavery/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
  1.8.0-25
  Android Designer EPL code available here:
  <a href="https://github.com/xamarin/AndroidDesigner.EPL" rel="nofollow noreferrer">https://github.com/xamarin/AndroidDesigner.EPL</a></p>
  
  <p>=== Android Device Manager ===</p>
  
  <p>Version: 7.8.1.0
  Hash: 8924ea4a</p>
  
  <p>=== Xamarin Inspector ===</p>
  
  <p>Version: 1.4.3
  Hash: db27525
  Branch: 1.4-release
  Build date: Mon, 09 Jul 2018 21:20:18 GMT
  Client compatibility: 1</p>
  
  <p>=== Build Information ===</p>
  
  <p>Release ID: 708020001
  Git revision: 13e0e5b7e85ffe742957e6f204bab5c06c644f0e
  Build date: 2019-02-27 19:33:14+00
  Build branch: release-7.8
  Xamarin extensions: 23eaa7c9cdc9a3f55be7bb87b485a790ec82ef25</p>
  
  <p>=== Operating System ===</p>
  
  <p>Mac OS X 10.13.6
  Darwin 17.7.0 Darwin Kernel Version 17.7.0
      Fri Nov  2 20:43:16 PDT 2018
      root:xnu-4570.71.17~1/RELEASE_X86_64 x86_64</p>
  
  <p>=== Enabled user installed extensions ===</p>
  
  <p>LiveXAML 1.3.31
  MFractor 3.7.10
  MvvmCross Template pack 2.0.1
  NuGet Package Management Extensions 0.15
  Template Creator 0.4
  Redth's Addins 1.0.9
  Internet of Things (IoT) development (Preview) 7.5</p>