RadioButton is leaving traces while scrolling on Android

I have an SfListView filled with items and a radiobutton at start. While i am scrolling down and then up again i able to see some traces from previous radiobuttons. I will upload a video and also a project for helping you understand better.


Attachment: ProjectVideo_54d39318.rar

7 Replies 1 reply marked as answer

LN Lakshmi Natarajan Syncfusion Team September 2, 2021 12:10 PM UTC

Hi Diogenis, 
 
Thank you for using Syncfusion products. 
 
We have checked the reported query “RadioButton is leaving traces while scrolling on Android” from our side. We would like to inform you that the SfListView is completely developed with UI Virtualization(Item recycling) concept and it only creates the element only which are in view on initial loading. While scrolling, we have cache the created elements and recycled it by updating only the BindingContext of the SfListView item. In this case, while scrolling, the IsChecked value will be updated and caused the reported scenario. 
 
However, you can overcome the reported scenario by skipping the reusing while scrolling by using the ListViewCachingStratedy as CreateNewTemplate.  
 
Please refer to the following code snippets to overcome the reported scenario, 
<syncfusion:SfListView x:Name="listView" ListViewCachingStrategy="CreateNewTemplate" ItemsSource="{Binding BookInfo}"> 
    <syncfusion:SfListView.ItemTemplate> 
        <DataTemplate> 
            <StackLayout Orientation="Horizontal" > 
                <syncfusion1:SfRadioButton IsChecked="{Binding IsChecked}" CheckedColor="DarkGreen" UncheckedColor="Gray"/> 
                <Label Text="{Binding BookDescription}" BackgroundColor="White" TextColor="Black"/> 
            </StackLayout> 
        </DataTemplate> 
    </syncfusion:SfListView.ItemTemplate> 
</syncfusion:SfListView> 
 
You can also refer to our user guidance document regarding the same, 
 
Please let us know if you need further assistance. 
 
Lakshmi Natarajan 
 


Marked as answer

DC Diogenis Christoforidis replied to Lakshmi Natarajan September 2, 2021 01:31 PM UTC

Hi Lakshmi Natarajan,

solution works perfect, my problem is that listivew doesn't scroll smoothly when ListViewCachingStrategy is been setting to CreateNewTemplate.


Is there any way to achieve smooth scrooling?



LN Lakshmi Natarajan Syncfusion Team September 3, 2021 07:15 AM UTC

Hi Diogenis, 
 
Thank you for the update. 
 
We would like to inform you that recycling is used to improve scrolling performance, whereas skipping it results in slightly lower performance. Also, you can achieve the smooth scrolling by disabling the SfListView’s default scrolling and load the ListView in the ScrollView.  
 
We have prepared a sample to overcome the reported scenario and attached in the following link, 
 
Please let us know if you need further assistance. 
 
Lakshmi Natarajan 
 



DC Diogenis Christoforidis September 3, 2021 05:07 PM UTC

Thank you  Lakshmi Natarajan it scrolls really fast now!!.


Just one more question. 

  1. What should be the ItemsCacheLimit number? Total collection's items? Example if my observable collection has 60 items i need to set this ItemsCacheLimit's value to 60?
  2. Can i use ListViewDependencyService for iOS?  If yes can you send me an example of class file?


LN Lakshmi Natarajan Syncfusion Team September 6, 2021 07:10 AM UTC

 
Hi Diogenis, 
 
Thank you for the update. 
 
Query 
Details 
What should be the ItemsCacheLimit number? Total collection's items? Example if my observable collection has 60 items i need to set this ItemsCacheLimit's value to 60? 
Gets or sets the cache limit for create and reuse the ListViewItems if different templates are used in DataTemplateSelector for better scrolling performance. Based on this value, SfListView creates the number of ListViewItems for different templates in the view and if new template is created while scrolling and reuse it if same template is used for improving the scrolling performance. 
 
Please find the details in our API reference, 
 
Additionally, the ItemsCacheLimit is not required in this case; we have included it for testing purposes only. Please disregard that. 
 
Can i use ListViewDependencyService for iOS?  If yes can you send me an example of class file? 
 
You can disable the SfListView’s default scrolling using dependency services. We have addressed the same query using dependency service and updated in the following forum with sample. 
 
Please find the sample and the code snippets in the following forum, 
 
 
 
Please let us know if you need further assistance. 
 
Regards, 
Lakshmi Natarajan 
 



DC Diogenis Christoforidis September 6, 2021 07:15 AM UTC

Thank you very much Lakshmi Natarajan!!! You have saved my day!



LN Lakshmi Natarajan Syncfusion Team September 6, 2021 12:44 PM UTC

Hi Diogenis, 
 
Thank you for the update. 
 
We are glad that our solution meets your requirement. Please let us know if you need any further assistance. As always, we are happy to help you out. 
 
Lakshmi Natarajan 
 


Loader.
Up arrow icon