Xamarin Forms Scroll View Not Working

TimHawkinsTimHawkins USMember ✭✭

I am trying to enable a Scrollview for a StackLayout which contains a bunch of absolute layout elements inside. However each time I add a AbsoluteLayout row the results height become scrunched and the scrollview does not apply. For the AbsoluteLayout Flags I tried to make the PositionProportional but when I do the Labels disappears and I cannot locate them when applying different values in Xamarin Forms Preview. Below is my code

            <StackLayout Spacing="0" Orientation="Vertical">
                <ScrollView Orientation="Vertical" VerticalOptions="StartAndExpand">
                    <StackLayout Spacing="0" Padding="0,0,0,5" x:Name="UnilateralPanel" Orientation="Vertical" HeightRequest="80">
                        <Label Text="Unilateral Cover Test" Style="{StaticResource headerRowStyle}"  />
                        <!--x, y, width, height-->
                        <AbsoluteLayout HeightRequest="20" HorizontalOptions="FillAndExpand">
                            <Label Text="Focal Distance" Style="{StaticResource resultTypeRow}" AbsoluteLayout.LayoutFlags="All"        AbsoluteLayout.LayoutBounds="0, 0,0.13,1" />
                            <Label Text="Cycle" Style="{StaticResource resultTypeRow}"  AbsoluteLayout.LayoutFlags="All"                AbsoluteLayout.LayoutBounds="0.16,0,0.08,1" />
                            <Label Text="Eye" Style="{StaticResource resultTypeRow}" AbsoluteLayout.LayoutFlags="All"                   AbsoluteLayout.LayoutBounds="0.26,0,.07,1"/>
                            <Label Text="Lateral Movement" Style="{StaticResource resultTypeRow}" AbsoluteLayout.LayoutFlags="All"      AbsoluteLayout.LayoutBounds="0.39,0,.15,1"/>
                            <Label Text="Lateral Direction" Style="{StaticResource resultTypeRow}" AbsoluteLayout.LayoutFlags="All"     AbsoluteLayout.LayoutBounds="0.59,0,.15,1"/>
                            <Label Text="Vertical Movement" Style="{StaticResource resultTypeRow}" AbsoluteLayout.LayoutFlags="All"     AbsoluteLayout.LayoutBounds="0.80,0,.16,1"/>
                            <Label Text="Vertical Direction" Style="{StaticResource resultTypeRow}" AbsoluteLayout.LayoutFlags="All"    AbsoluteLayout.LayoutBounds="1,0,.15,1"/>
                        </AbsoluteLayout>
                        <!--This is test data to simulate what results-->
                        <AbsoluteLayout HeightRequest="20" HorizontalOptions="FillAndExpand" BackgroundColor="{StaticResource LightGrey}">
                            <Label Text="Near" Style="{StaticResource resultTypeRow}" AbsoluteLayout.LayoutFlags="All"        AbsoluteLayout.LayoutBounds="0, 0,0.13,1" />
                            <Label Text="1" Style="{StaticResource resultTypeRow}"  AbsoluteLayout.LayoutFlags="All"                AbsoluteLayout.LayoutBounds="0.16,0,0.08,1" />
                            <Label Text="OD" Style="{StaticResource resultTypeRow}" AbsoluteLayout.LayoutFlags="All"                   AbsoluteLayout.LayoutBounds="0.26,0,.07,1"/>
                            <Label Text="19.1" Style="{StaticResource resultTypeRow}" AbsoluteLayout.LayoutFlags="All"      AbsoluteLayout.LayoutBounds="0.39,0,.15,1"/>
                            <Label Text="Ortho" Style="{StaticResource resultTypeRow}" AbsoluteLayout.LayoutFlags="All"     AbsoluteLayout.LayoutBounds="0.59,0,.15,1"/>
                            <Label Text="10.356" Style="{StaticResource resultTypeRow}" AbsoluteLayout.LayoutFlags="All"     AbsoluteLayout.LayoutBounds="0.80,0,.16,1"/>
                            <Label Text="Ortho" Style="{StaticResource resultTypeRow}" AbsoluteLayout.LayoutFlags="All"    AbsoluteLayout.LayoutBounds="1,0,.15,1"/>
                        </AbsoluteLayout>
                    </StackLayout>
                </ScrollView>
Sign In or Register to comment.