Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Issue with Grid sizing

$
0
0

Hi, I'm having issues with the Sizing of a Grid. It is inside a ContentView and is set to expand horizontally, so the expectation is that it will fill the view, which it does. Then if I add 2 children on different rows and and set them to fill and expand horizontally they don't, they just hug the left hand size and fill to the size of the largest child.

<ContentView Grid.Column="0" Grid.Row="0" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" 
BackgroundColor="Silver" Padding="5">
    <Grid Grid.Column="0" Grid.Row="0" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" 
    BackgroundColor="Green">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Label Text="Messages" TextColor="White" HorizontalOptions="FillAndExpand" />
        <Button Text="GO" TextColor="White" BackgroundColor="Black" Grid.Row="1" HorizontalOptions="FillAndExpand"
         VerticalOptions="EndAndExpand" />
    </Grid>
</ContentView>

see attached emulator screenshot (IPhone)


Viewing all articles
Browse latest Browse all 58056

Trending Articles