ScrollView doesn't scroll

JasonAwbreyJasonAwbrey USInsider, University, Developer Group Leader mod

I have a page with a scrollview wrapping a StackLayout - something I do on lots of pages and works great. However, on one page it does not - no scrolling, and when I click on the Editor control in the page the keyboard hides the Editor instead of scrolling.

There are two things I'm doing differently on this page - I have Image controls with no ImageSource (they are set by user interaction) and I have a section of the StackLayout that is hidden depending on the value of a switch. I've tried removing both of these to fix the problem, but it persists.

I recall seeing similar issues relating to this and the ScrollView not being able to figure out the sizing, but I can't find anything that points to the right solution.

What am I missing?

    <ContentPage.Content>
        <ScrollView>
            <StackLayout Padding="10" BackgroundColor="#cae5ee">
                <StackLayout Orientation="Horizontal">
                    <Label HorizontalOptions="FillAndExpand" VerticalOptions="Center" Text="Attended?" />
                    <Switch x:Name="Attended" />
                </StackLayout>

                <StackLayout Orientation="Horizontal">
                    <Label HorizontalOptions="FillAndExpand" VerticalOptions="Center" Text="Subject to Inspection?" />
                    <Switch x:Name="Inspection" />
                </StackLayout>

                <StackLayout Orientation="Horizontal">
                    <Label HorizontalOptions="FillAndExpand" VerticalOptions="Center" Text="Customer Delayed?" />
                    <Switch x:Name="Delayed" Toggled="DelayToggled" />
                </StackLayout>

                <StackLayout x:Name="ReasonRow" Orientation="Horizontal" IsVisible="true">
                    <Button Clicked="SelectReason" Text="Reason:" />
                    <Label HorizontalOptions="FillAndExpand" VerticalOptions="Center" x:Name="Reason"  />
                </StackLayout>

                <Image IsVisible="true" x:Name="CustomerSig" HeightRequest="75" BackgroundColor="White" Source="blank.png"  />
                <StackLayout Orientation="Horizontal" >
                    <Button Text="Customer Signature" Clicked="GetCustomerSignature" />
                    <Editor HeightRequest="35" VerticalOptions="Center" HorizontalOptions="FillAndExpand" x:Name="CustomerName" />
                </StackLayout>
                <Image IsVisible="true" x:Name="DriverSig" HeightRequest="75" BackgroundColor="White" Source="blank.png" />
                <StackLayout Orientation="Horizontal" >
                    <Button Text="Driver Signature" Clicked="GetDriverSignature" />
                    <Label VerticalOptions="Center" HorizontalOptions="FillAndExpand" x:Name="DriverName" Text="John Doe" />
                </StackLayout>
            </StackLayout>
        </ScrollView>
    </ContentPage.Content>

Answers

Sign In or Register to comment.