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

3 rows 20%x40%x40%

$
0
0

The attached file shows what i'm trying to do, it's a simple layout, 3 rows divided on percentages.

I tried so far, no success:

<!-- One: how can I put percentage on this? -->
<StackLayout BackgroundColor="Fuschia">
    <BoxView BackgroundColor="Red" VerticalOptions="FillAndExpand"></BoxView>
    <BoxView BackgroundColor="Yellow" VerticalOptions="FillAndExpand"></BoxView>
    <BoxView BackgroundColor="Blue" VerticalOptions="FillAndExpand"></BoxView>
  </StackLayout>

<!-- Two: how can I put percentage on this, too? And this one does not fill horizontal -->
<Grid VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
    <Grid.RowDefinitions>
      <RowDefinition Height="*" />
      <RowDefinition Height="*" />
      <RowDefinition Height="*" />
    </Grid.RowDefinitions>

    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>

    <BoxView
        Grid.Row="0" Grid.Column="0"
        BackgroundColor="Blue" />

    <BoxView
        Grid.Row="1" Grid.Column="0"
        BackgroundColor="Red" />

     <BoxView
        Grid.Row="2" Grid.Column="0"
        BackgroundColor="Yellow" />
  </Grid>

Viewing all articles
Browse latest Browse all 58056

Trending Articles