Animation when accordion item disappears

Hello,

I have an accordion and each accordion item is an sflistview. In the footer of each listview is a button. When that button is clicked, I want that accordion item to disappear, but I want it to fade out. How can I achieve this functionality?

Thank you

2 Replies 1 reply marked as answer

SB Spencer Bosley February 11, 2021 03:04 AM UTC

To be more specific, I am just looking for the functionality to fade out the accordion item.


LN Lakshmi Natarajan Syncfusion Team February 11, 2021 10:06 AM UTC

Hi Spencer, 
 
Thank you for using Syncfusion products. 
 
We have checked the reported query “Animation when accordion item disappears” from our side. We would like to inform you that you can achieve your requirement by using the FadeTo method in Xamarin.Forms.  
 
Please refer to the following code snippets to achieve your requirement, 
private void OnDeleteClicked(object obj) 
{ 
    var accordionItem = obj as Syncfusion.XForms.Accordion.AccordionItem; 
    var itemData = accordionItem.BindingContext as ItemInfo; 
 
    if (itemData != null) 
    { 
        accordionItem.Header.FadeTo(0, 1000); 
        accordionItem.Content.FadeTo(0, 1000); 
 
        Device.BeginInvokeOnMainThread(async() => 
        { 
            await Task.Delay(1000); 
            Info.Remove(itemData); 
        });      
    } 
} 
 
We have prepared a sample based on your requirement and you can refer from the following link, 
 
Please let us know if you need further assistance. 
 
Regards, 
Lakshmi Natarajan 


Marked as answer
Loader.
Up arrow icon