0
votes

I have a view with grid which consists of two stacklayouts positioned vertically. I would like an effect that second stacklayout has scrollview only because I build its content dynamically on page model side. When content of second stacklayout is built then on screen I see only that second stacklayout. I want to see first and second already built with possibility of scrolling. Any ideas ?

    <StackLayout VerticalOptions="StartAndExpand" Spacing="0">
                <Grid RowSpacing="0" ColumnSpacing="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="*"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.2*"></ColumnDefinition>
                        <ColumnDefinition Width="0.2*"></ColumnDefinition>
                        <ColumnDefinition Width="0.2*"></ColumnDefinition>
                        <ColumnDefinition Width="0.2*"></ColumnDefinition>
                        <ColumnDefinition Width="0.2*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <StackLayout Spacing="0" VerticalOptions="StartAndExpand"
                                 Margin="0" Padding="0" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="5">
<Some static content/>
                    </StackLayout>
                    <StackLayout Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="5" Spacing="0" Margin="0">
                        <ScrollView>
                            <StackLayout x:Name="details">
                            </StackLayout>
                        </ScrollView>
                    </StackLayout>
                </Grid>
            </StackLayout>
2

2 Answers

3
votes

The definition of your Grid rows are wrong. The StackLayout with ScrollView should have * and the other should have Auto Height.

1
votes
<ScrollView>
  <StackLayout x:Name="details">
    Layout overflow is required. otherwise, it is not displayed.
    Add buttons for example.
  </StackLayout>
</ScrollView>