Height problem when nesting tableview inside stacklayout inside rowdefinition

PatrickJelittoPatrickJelitto Member ✭✭✭
edited June 2018 in Xamarin.Forms

Hi Guys,

i have the following xaml:

> <Grid>
>    <Grid.Rowdefinitions>
>        <Rowdefinition Height="AUTO"/>
>        <Rowdefinition Height="AUTO"/>
>    </Grid.Rowdefinitions>
> 
>    <StackLayout Orientation="Vertical" Grid.Row="0">
>    // some content here
>    </StackLayout/>
> 
>    <StackLayout Orientation="Vertical" Grid.Row="1"> <--- MainStackLayout
>        <TableView HasUnevenRows="True">
>            <TableRoot>
>                <TableSection>
>                    <StackLayout IsVisible="False">   <---- this stacklayout is handled by a CheckedChanged Event and will get visible when checked
>                    // some content in here
>                    </StackLayout>
>                </TableSection>
>            </TableRoot>
>        </TableView
>    </StackLayout>
> </Grid>

What i want to achieve, is that the height of the second RowDefinition (or maybe the StackLayout inside) always fits its content, no matter if the StackLayout inside the MainStackLayout is visible or invisible.

Thanks for your help :)

Answers

  • PatrickJelittoPatrickJelitto Member ✭✭✭

    still need help please :) PS: does anyone know why some xaml elements disappear when i format it as "code" here in the forum?

  • SzbestaSzbesta Member ✭✭✭

    @Gelatto Im sorry i cant be of use with the Grid cause i hate it and never use it. But concerning your PS if you put 3 Backtick above and below your code there shouldn be any formatting problems so no dissapearing elements or such!

Sign In or Register to comment.