Grid will not expand vertically to fit content

What I am trying to do is have a 2 column grid inside a listview to show my search results. I cannot get the row to fit the content vertically unless I specifically supply a RowHeight in the XAML. I tried simplifying the grid. Even putting everything in a stacklayout as shown below. All that happens is I can read the bound value from f1. Everything else gets cropped out. Ideally just looking to use the Grid without the inner StackLayout, I only tried it hoping it would work.

What am I missing???

I am testing this on Android.

            <Label x:Name="NewMatchHeader" FontSize="18" TextColor="Black" FontAttributes="Bold" Text="{Binding MatchCount}" />
        <StackLayout VerticalOptions="FillAndExpand">
            <ListView x:Name="NewMatchesView"
                  ItemsSource="{Binding Results}"
                  SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
                                    <RowDefinition Height="Auto" />


                                    <ColumnDefinition Width="*" />
                                <StackLayout Grid.Column="0" Grid.Row="0" Orientation="Vertical" VerticalOptions="StartAndExpand">
                                    <Label Text="{Binding f1}" FontSize="32" FontAttributes="Bold" TextColor="{StaticResource highlightColor}"/>
                                    <Label Text="{Binding f2}" TextColor="#999999"  FontSize="14" />
                                    <Label Text="{Binding f3}" TextColor="#999999" FontSize="12"/>
                                    <Label Text="{Binding f4}" TextColor="#999999"  FontSize="12"/>


Best Answer


  • elpresidente408elpresidente408 Member ✭✭

    I can't believe it was that simple...haha. That fixed it.

Sign In or Register to comment.