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

Item of Grid does not fit in cell

$
0
0

Hi everyone,

I have faced with issue that Grid Item does not fit in cell:

<Grid
    VerticalOptions="FillAndExpand"
    x:Name="Grid"
    RowSpacing="15"
    ColumnSpacing="15">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="50" />
        <ColumnDefinition Width="50" />
        <ColumnDefinition Width="50" />
    </Grid.ColumnDefinitions>

    <Grid.RowDefinitions>
        <RowDefinition Height="100" />
        <RowDefinition Height="100" />
        <RowDefinition Height="100" />
    </Grid.RowDefinitions>

    <StackLayout
        VerticalOptions="FillAndExpand"
        HorizontalOptions="FillAndExpand"
        Grid.Row="0"
        Grid.Column="0">
        <Image
            WidthRequest="50"
            HeightRequest="50"
            Source="{utilsme:ImageResource MyApp.Forms.Resources.Images.my_image.png}"/>
        <Label
            Text="Home 0"
            HeightRequest="10"
            VerticalOptions="CenterAndExpand" 
            HorizontalOptions="CenterAndExpand" />
    </StackLayout>
    <!-- Other items -->
</Grid>

As result I have the following drawing:

Also I have found the following issue:

https://forums.xamarin.com/discussion/21532/grid-not-expanding-to-fit-content

But seems like over the years it still does not fixed ...

Guys, how to fix this behavior of the Grid ?


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>