BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
I want to have a decorated tap effect along with a swipe gesture that will quick delete items in my SfListView. Is it possible to use the SfEffectsView with SfListView swiping? I have tried wrapping my SfEffectsView inside of a ViewCell and a Grid but I'm still not able to trigger the swipe event with the SfEffectsView as my DataTemplate's "Background" container. Whenever I remove the SfEffectsView from the DataTemplate, the swipe event and animation are triggered as intended. Will I need to pick between having an animated item tap event and an animated swipe event or is there a way to have both?
I know that I can utilize the SfListView's SelectionBackgroundColor and SelectionChanged properties to highlight the user's selection temporarily before I navigate but I think the SfEffectsView animation looks better. If I can achieve this behavior now or through a future Nuget Update, amazing! If not, I would like to know so that I can find an alternative.
Also, I forgot to mention that all of this is wrapped inside of a SfPopupLayout.Content if that makes any difference.
Thanks,
Bryson
Hi Bryson,
Thanks for contacting Syncfusion support.
We would like to let you know that, SfListView allows you to use the visual effect by setting the Visual element as “Material ”, which uses the effects on tap and allows you to swipe and select the listview item. We have attached the sample, code snippet, and documentation for your reference. Please have a look at the sample and let us if you have any concerns.
Code snippet:
In XAML:
<ContentPage xmlns=http://xamarin.com/schemas/2014/forms xmlns:x=http://schemas.microsoft.com/winfx/2009/xaml Visual="Material"> <ContentPage.BindingContext> <local:ViewModel /> </ContentPage.BindingContext>
<ContentPage.Behaviors> <local:Behavior/> </ContentPage.Behaviors>
<Grid RowSpacing="0" ColumnSpacing="0" Padding="0" Margin="0"> <sync:SfListView x:Name="listView" AutoFitMode="Height" SwipeStarted="listView_SwipeStarted" SwipeEnded="listView_SwipeEnded" SelectionChanged="listView_SelectionChanged" ItemsSource="{Binding BookInfo}" SelectionBackgroundColo |
In C#:
public class ItemGeneratorExt : ItemGenerator { public ItemGeneratorExt(SfListView listview) : base(listview) {
} protected override ListViewItem OnCreateListViewItem(int itemIndex, ItemType type, object data = null) { if (type == ItemType.Record) return new ListViewItemExt(type); return base.OnCreateListViewItem(itemIndex, type, data); } } |
public class ListViewItemExt : ListViewItem { public ListViewItemExt() { } public ListViewItemExt(ItemType type) : base(type) {
} protected override void OnItemAppearing() { this.Opacity = 0; this.FadeTo(1, 400, Easing.SinInOut); base.OnItemAppearing(); } } |
Not that classes are proposed synched as fusion in cold fusion or in .net
Hi Kin Bueno,
Could you please explain your requirements in detail? This would be helpful for us to serve you.
Regards,
Preethi R