title: Xamarin Forms - control the height of a button in a grid
body: <p>Notice the two buttons below.  The first is in a StackLayout, and the second is in a 1x1 grid cell.  The first obeys the HeightRequest property, but the second will not.</p>
  
  <p>How can I control the size of a Button inside of a GridCell?</p>
  
  <p><a href="https://i.stack.imgur.com/mZEiN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mZEiN.png" alt="enter image description here"></a></p>
  
  <p><strong>XAML</strong></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"
               xmlns:local="clr-namespace:SimpleApp"
               x:Class="SimpleApp.MainPage"&gt;
      &lt;StackLayout&gt;
          &lt;Button Text="Button" 
                  HeightRequest="30" 
                  HorizontalOptions="Center" /&gt;
          &lt;Grid&gt;
              &lt;Grid.RowDefinitions&gt;
                  &lt;RowDefinition Height="200" /&gt;
              &lt;/Grid.RowDefinitions&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition /&gt;
              &lt;/Grid.ColumnDefinitions&gt;
              &lt;Button Text="Button" 
                      HeightRequest="30"
                      HorizontalOptions="Center" 
                      Grid.Row="0" Grid.Column="0" /&gt;
          &lt;/Grid&gt;
      &lt;/StackLayout&gt;
  &lt;/ContentPage&gt;
  </code></pre>