title: Remove white space at bottom of page xamarin.forms
body: <p>I have this Xamain.Forms app where I hide page title when the device orientation changes. It all works fine but on Android a white space is showing above the content when I switch to horizontal view. You can see how it looks in the pictures below.</p>
  
  <p><a href="https://i.stack.imgur.com/P3jJ0.png" rel="nofollow noreferrer">enter image description here</a>
  <a href="https://i.stack.imgur.com/tj6vN.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>This is my xaml code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
           xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
           x:Class="Kanal10Live.VideoTest"&gt;
  &lt;ContentPage.Content&gt;
      &lt;StackLayout x:Name="VideoStack"&gt;
          &lt;WebView x:Name="Browser" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"&gt;&lt;/WebView&gt; 
      &lt;/StackLayout&gt;
  &lt;/ContentPage.Content&gt;
  </code></pre>
  
  <p></p>
  
  <p>And this is code behind:</p>
  
  <pre><code>private double width = 0;
      private double height = 0;
      protected override void OnSizeAllocated(double width, double height)
      {
          base.OnSizeAllocated(width, height);
  
          switch (Device.RuntimePlatform)
          {
              case Device.Android:
                  if (width != this.width || height != this.height)
                  {
                      this.width = width;
                      this.height = height;
                      if (width &gt; height)
                      {
                          NavigationPage.SetHasNavigationBar(this, false);
                          VideoStack.Orientation = StackOrientation.Horizontal;                            
                      }
                      else
                      {
                          NavigationPage.SetHasNavigationBar(this, true);
                          VideoStack.Orientation = StackOrientation.Vertical;
                      }
                  }
  
                  break;
  
          }
  
      }
  </code></pre>
  
  <p>The funny thing is that if I use the below code when the page initializes all is fine.</p>
  
  <p>If someone can help me I would be grateful!</p>
  
  <p>Peter</p>