title: Image does not fill horizontally with AspectFill in a nested layout
body: <p>I have a Relative layout inside Grid in Xamarin Forms. There is an image inside the relative layout. The image has AspectFill.</p>
  
  <p><a href="https://developer.xamarin.com/api/field/Xamarin.Forms.Aspect.AspectFill/" rel="nofollow noreferrer">Xamarin.Forms.Aspect.AspectFill Field</a> says:</p>
  
  <blockquote>
    <p>Scale the image to fill the view. Some parts may be clipped in order to fill the view.</p>
  </blockquote>
  
  <p>Still the image is not filling horizontally. How to fix it.</p>
  
  <p><strong>XAML</strong></p>
  
  <pre><code> &lt;Grid x:Name="controlGrid" ColumnSpacing="0" Padding="0"&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="2*" /&gt;
          &lt;RowDefinition Height="2*" /&gt;
          &lt;RowDefinition Height="8*" /&gt;
          &lt;RowDefinition Height="1*" /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="*" /&gt;
          &lt;ColumnDefinition Width="*" /&gt;
      &lt;/Grid.ColumnDefinitions&gt;
  
  
      &lt;!--Row 1--&gt;
      &lt;BoxView Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" BackgroundColor="Red" HeightRequest="1" VerticalOptions="End" HorizontalOptions="FillAndExpand" Margin="0" /&gt;
      &lt;BoxView Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" BackgroundColor="Red" HeightRequest="1" VerticalOptions="Start" HorizontalOptions="FillAndExpand" Margin="0"/&gt;
      &lt;BoxView Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" BackgroundColor="Red" WidthRequest="1" VerticalOptions="FillAndExpand" HorizontalOptions="End" Margin="0"/&gt;
      &lt;BoxView Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" BackgroundColor="Red" WidthRequest="1" VerticalOptions="FillAndExpand" HorizontalOptions="Start" Margin="0"/&gt;
  
      &lt;RelativeLayout Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" &gt;
          &lt;Image Source="abstracttrianglex.png" Aspect="AspectFill" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="Red"/&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;!--Row 2--&gt;
      &lt;RelativeLayout Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" BackgroundColor="Teal" &gt;
          &lt;Image Source="abstracttrianglex.png"  Aspect="AspectFill" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="Blue"/&gt;
      &lt;/RelativeLayout&gt;
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/xLdCC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xLdCC.png" alt="enter image description here"></a></p>