Share via

Scrollview is overlapping above elements when scrolled in xamarin android project.

hira 21 Reputation points
2021-03-23T07:03:09.96+00:00

Setting android: hardwareAccelerated = "false" in Android Manifest causes a problem with this code. Is this a bug in Xamarin.forms? Is there a solution?

       <StackLayout>
            <Label Text = "Top" x:Name="label1" HeightRequest="100"  HorizontalOptions="Center" VerticalOptions="Center"/>

        <ScrollView x:Name="scroll" Orientation="Both" >

            <StackLayout>
                <Label BackgroundColor="Yellow" 
             Text="1111111111111aaaaaaaaaaaaaaaaaaddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"       
            HeightRequest="500" 
            WidthRequest="150" />

               <Label BackgroundColor="Accent" 
             Text="test2fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"       
            HeightRequest="300" 
            WidthRequest="150" />

            </StackLayout>


        </ScrollView>
        <Label Text = "bottom" x:Name="label2" HeightRequest="100" HorizontalOptions="Center" VerticalOptions="Center"/>
    </StackLayout>
Developer technologies | .NET | Xamarin
0 comments No comments

Answer accepted by question author

JarvanZhang 23,971 Reputation points
2021-03-23T08:21:59.737+00:00

Hello,​

Welcome to our Microsoft Q&A platform!

Hi,hira-7329. Hardware acceleration works for the Android 2D rendering on Android, and it'll be enabled by default since Android API 14. Disable the function may affect
the views' rendering. This is a known issue and someone posted it on github. Please enable the acceleration when using Xamarin.Forms.ScrollView on Android.

Best Regards,

Jarvan Zhang


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.