title: Xamarin.forms webview auto height with content
body: <p>I am using a Webview and Label control on my page. I want to show the label once the WebView has scrolled to the end of its content.
  Here is an image showing what is happening:</p>
  
  <p><a href="https://i.stack.imgur.com/c5nuG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c5nuG.jpg" alt="enter image description here"></a></p>
  
  <p>The label always stays at the bottom.</p>
  
  <p>I have tried this code:</p>
  
  <pre><code>&lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="*"/&gt;
          &lt;RowDefinition Height="Auto"/&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;WebView Grid.Row="0"  Source="{Binding DetailHtml}"&gt;&lt;/WebView&gt;
      &lt;Label Grid.Row="1" Text="TIN LIÊN QUAN" TextColor="#5ea201" FontAttributes="Bold"/&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>and this: </p>
  
  <pre><code>&lt;StackLayout&gt;
      &lt;WebView Source="{Binding DetailHtml}"&gt;&lt;/WebView&gt;
      &lt;Label  Text="TIN LIÊN QUAN" TextColor="#5ea201" FontAttributes="Bold"/&gt;
  &lt;/StackLayout&gt;
  </code></pre>
  
  <p>I also tried to use a custom renderer for WebView to set the height but it doesn't work:</p>
  
  <pre><code>[assembly: ExportRenderer(typeof(WebView), typeof(WebViewCustomRenderer))]
  namespace SucKhoeGiaDinh.iOS.Renderers
  {
      public class WebViewCustomRenderer : WebViewRenderer
      {
          protected override void OnElementChanged(VisualElementChangedEventArgs e)
          {
              base.OnElementChanged(e);
              Delegate = new ExtendedUIWebViewDelegate(this);
          }
      }
  
      public class ExtendedUIWebViewDelegate : UIWebViewDelegate
      {
          WebViewCustomRenderer webViewRenderer;
  
          public ExtendedUIWebViewDelegate(WebViewCustomRenderer _webViewRenderer = null)
          {
              webViewRenderer = _webViewRenderer ?? new WebViewCustomRenderer();
          }
  
          public override async void LoadingFinished(UIWebView webView)
          {
              if (webViewRenderer.Element is WebView wv)
              {
                  await System.Threading.Tasks.Task.Delay(100); // wait here till content is rendered
                  wv.HeightRequest = (double)webView.ScrollView.ContentSize.Height;
              }
          }
      }
  }
  </code></pre>
  
  <p>It there another approach I could use to achieve this?</p>