Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Scrollview inside and outside Absolute Layout is not working

Mahesh453261Mahesh453261 Member ✭✭

Below is the code I would like to have kinda 3 page scroll view wrapped up inside an absolute layout but doesn't working.

<AbsoluteLayout>
<Frame BackgroundColor="Azure" CornerRadius="20">
    <ScrollView AbsoluteLayout.LayoutBounds="0,0,2,2" AbsoluteLayout.LayoutFlags="All">
        <StackLayout>
        <StackLayout Orientation="Horizontal" Padding="20,20,20,20" HorizontalOptions="Center">
        <Frame WidthRequest="100">
            <StackLayout BackgroundColor="AliceBlue">
                <Image Source="tables.jpg" HorizontalOptions="Center" VerticalOptions="Center" Aspect="Fill"/>
                <Label Text="Tables" HorizontalOptions="Center"/>
            </StackLayout>
        </Frame>
            <Frame BackgroundColor="#CCFFC" WidthRequest="100">
                <StackLayout>
                    <Image Source="tables.jpg" HorizontalOptions="Center" VerticalOptions="Center" Aspect="Fill"/>
                    <Label Text="Tables" HorizontalOptions="Center"/>
                </StackLayout>
            </Frame>
        </StackLayout>
        <StackLayout Orientation="Horizontal" Padding="20,20,20,20" HorizontalOptions="Center">
                <Frame BackgroundColor="#CCFFC" WidthRequest="100">
                    <StackLayout BackgroundColor="AliceBlue">
                    <Image Source="tables.jpg" HorizontalOptions="Center" VerticalOptions="Center" Aspect="Fill"/>
                    <Label Text="Tables" HorizontalOptions="Center"/>
                </StackLayout>
            </Frame>
                <Frame BackgroundColor="#CCFFC" WidthRequest="100">
                    <StackLayout>
                    <Image Source="tables.jpg" HorizontalOptions="Center" VerticalOptions="Center" Aspect="Fill"/>
                    <Label Text="Tables" HorizontalOptions="Center"/>
                </StackLayout>
            </Frame>
        </StackLayout>
            <StackLayout Orientation="Horizontal" Padding="20,20,20,20" HorizontalOptions="Center">
                <Frame BackgroundColor="#CCFFC" WidthRequest="100">
                    <StackLayout BackgroundColor="AliceBlue">
                        <Image Source="tables.jpg" HorizontalOptions="Center" VerticalOptions="Center" Aspect="Fill"/>
                        <Label Text="Tables" HorizontalOptions="Center"/>
                    </StackLayout>
                </Frame>
                <Frame BackgroundColor="#CCFFC" WidthRequest="100">
                    <StackLayout>
                        <Image Source="tables.jpg" HorizontalOptions="Center" VerticalOptions="Center" Aspect="Fill"/>
                        <Label Text="Tables" HorizontalOptions="Center"/>
                    </StackLayout>
                </Frame>
            </StackLayout>
        </StackLayout>
    </ScrollView>
</Frame>
</AbsoluteLayout> 

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    What exactly do you want ? Could you provide a image to demonstrate ?

    Not working does not help , you mean incorrect control size ? scroll gesture not work ? or something else ?

    I remove the AbsoluteLayout , the scrollview scroll as expected ,why you use AbsoluteLayout here ?

  • Mahesh453261Mahesh453261 Member ✭✭

    Scroll view is not working. Layout is not scrollable at all. It shows only the single page data

  • ColeXColeX Member, Xamarin Team Xamurai

    Remove AbsoluteLayout and try again .

Sign In or Register to comment.