title: Aligning Image with Entry in Xamarin Forms
body: <p>In the following Xamarin Forms code, I am trying to align Image with Entry to create visual appearance like a bootstrap input-group as explained in <a href="https://stackoverflow.com/questions/29559370/bootstrap-input-group-addon-alignment-problems">Bootstrap input group addon alignment problems</a></p>
  
  <p>But it has following shortcomings:</p>
  
  <ol>
  <li>The image takes more width and height than specified HeightRequest and WidthRequest</li>
  <li>There is unwanted space between Image and Entry</li>
  </ol>
  
  <p>How to fix this?</p>
  
  <p><a href="https://i.stack.imgur.com/sa7Uv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sa7Uv.png" alt="enter image description here"></a></p>
  
  <p>XAML</p>
  
  <pre><code>&lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
               xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
               xmlns:local="clr-namespace:MyHomeScreen2;assembly=MyHomeScreen2"
               x:Class="MyHomeScreen2.InputFormTest"
               NavigationPage.HasNavigationBar="False"&gt;
      &lt;ContentPage.Content&gt;
          &lt;Grid x:Name="inputGrid" Grid.Row="1" ColumnSpacing="0" RowSpacing="0" Padding="0" BackgroundColor="#606060"&gt;
              &lt;Grid.RowDefinitions&gt;
                  &lt;RowDefinition Height="*" /&gt;
                  &lt;RowDefinition Height="*" /&gt;
                  &lt;RowDefinition Height="*" /&gt;
                  &lt;RowDefinition Height="*" /&gt;
                  &lt;RowDefinition Height="*" /&gt;
              &lt;/Grid.RowDefinitions&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Width="*" /&gt;
              &lt;/Grid.ColumnDefinitions&gt;
  
              &lt;Label x:Name="lblReading" TextColor="White"  Text="READING" Grid.Row="0" Margin="15"&gt;&lt;/Label&gt;
  
              &lt;StackLayout Grid.Row="1" Orientation="Horizontal"&gt;
                  &lt;Image Source="homea.png" Aspect="AspectFit" 
                         HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" 
                         HeightRequest="10" WidthRequest="20"
                         BackgroundColor="Silver" &gt;&lt;/Image&gt;
                  &lt;Entry x:Name="myEntry" TextColor="Black"  Text="1" Keyboard="Numeric"  BackgroundColor="White"  
                             Opacity="0.9" HeightRequest="20"&gt;
                  &lt;/Entry&gt;
              &lt;/StackLayout&gt;
          &lt;/Grid&gt;
      &lt;/ContentPage.Content&gt;
  &lt;/ContentPage&gt;
  </code></pre>