The trackball disappears on Android if the parent scroll view is moved

Hi,

I am working with the SfCartesianChart, and when I try to show the trackball on Android, it disappears when the user drags their finger and the main scroll movement is detected.


<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"

             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

             xmlns:chart="clr-namespace:Syncfusion.Maui.Charts;assembly=Syncfusion.Maui.Charts"

             xmlns:local="clr-namespace:CallCommandWhenTrackballHide"

             x:Class="CallCommandWhenTrackballHide.MainPage">


    <ContentPage.BindingContext>

        <local:ViewModel/>

    </ContentPage.BindingContext>


    <Grid RowDefinitions="*,9*">

        <Button Clicked="Button_Clicked" Grid.Row="0" Text="EnableScroll"/>


        <ScrollView x:Name="scrollview" Orientation="Both" Grid.Row="1" IsEnabled="True">

            <VerticalStackLayout>

                <Slider Value="5" Minimum="0" Maximum="10" ValueChanged="Slider_ValueChanged"/>

                <chart:SfCartesianChart HeightRequest="900">


                    <chart:SfCartesianChart.XAxes>

                        <chart:NumericalAxis/>

                    </chart:SfCartesianChart.XAxes>


                    <chart:SfCartesianChart.YAxes>

                        <chart:NumericalAxis/>

                    </chart:SfCartesianChart.YAxes>


                    <chart:SfCartesianChart.TrackballBehavior>

                        <local:CustomTrackballBehavior/>

                    </chart:SfCartesianChart.TrackballBehavior>


                    <chart:LineSeries ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue"/>

                </chart:SfCartesianChart>

            </VerticalStackLayout>

        </ScrollView>

    </Grid>


</ContentPage>


could you help us pls


1 Reply

DR Dhanaraj Rajendran Syncfusion Team September 3, 2024 01:54 PM UTC

Hi Jair,


Thank you for reaching out. We’ve reviewed your query and understand the issue you’re facing with the trackball disappearing when the user scrolls on Android.

In the previous thread, we provided a sample that demonstrates how to keep the trackball visible while scrolling inside the chart. Below provided the related thread link and we've attached that sample again for your reference.

Thread Link: https://www.syncfusion.com/forums/193536/i-can-not-use-sfchartrenderer-in-donet-maui

We’d also like to clarify that when touch events are released from the child view, the parent view (in this case, the ScrollView) regains control of the touch events. This is the expected behavior.

To better assist you, could you please confirm your specific expectations? Are you looking to keep the trackball visible and scroll while the user is scrolling within the main ScrollView component?

We appreciate your patience and look forward to your response.


Regards,

Dhanaraj Rajendran.


Attachment: SF_193536_2_41328cd6.zip

Loader.
Up arrow icon