question

hira-7329 avatar image
0 Votes"
hira-7329 asked RobCaplan edited

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

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>

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JarvanZhang-MSFT avatar image
0 Votes"
JarvanZhang-MSFT answered JarvanZhang-MSFT edited

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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.