We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can't Swipe on SfListView at iOS

Thread ID:

Created:

Updated:

Platform:

Replies:

128461 Jan 24,2017 12:02 PM UTC Apr 21,2017 07:32 AM UTC Xamarin.Forms 4
loading
Tags: SfListView
huhu
Asked On January 24, 2017 12:02 PM UTC

hello:
I Can't Swipe on SfListView  at iOS

Emil
Replied On January 24, 2017 03:04 PM UTC

You should give more details. what is your xaml or code looks like? 

huhu
Replied On January 25, 2017 12:53 AM UTC

hello: 
here is my code :
            var lv = new SfListView
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand,
                BackgroundColor = ColorHelper.LightGray,
                SelectionMode = Syncfusion.ListView.XForms.SelectionMode.Single,
                ItemSpacing = 1,
                ItemSize = 50,
                ItemTemplate = new DataTemplate(typeof(hMSG001ListViewCell)),
                RightSwipeTemplate = new DataTemplate(() =>
                {
                    var imgFavorites = new CachedImage
                    {
                        HorizontalOptions = LayoutOptions.Start,
                        VerticalOptions = LayoutOptions.FillAndExpand,
                        BackgroundColor = ColorHelper.LightBlue,
                        Source = hResourcesHelper.FromResource("img_MSG_100_Favorite_White.png")
                    };
                    var imgForward = new CachedImage
                    {
                        HorizontalOptions = LayoutOptions.Start,
                        VerticalOptions = LayoutOptions.FillAndExpand,
                        BackgroundColor = ColorHelper.Green,
                        Source = hResourcesHelper.FromResource("img_MSG_100_Forward_White.png")
                    };

                    {
                        var tap = new TapGestureRecognizer();
                        tap.Tapped += Favorites_Tapped;
                        imgFavorites.GestureRecognizers.Add(tap);
                    }
                    {
                        var tap = new TapGestureRecognizer();
                        tap.Tapped += Forward_Tapped;
                        imgForward.GestureRecognizers.Add(tap);
                    }

                    return new StackLayout
                    {
                        HorizontalOptions = LayoutOptions.Start,
                        VerticalOptions = LayoutOptions.FillAndExpand,
                        Orientation = StackOrientation.Horizontal,
                        Padding = 0,
                        Spacing = 0,
                        Children =
                        {
                            imgFavorites,
                            imgForward
                        }
                    };
                }),

                SwipeOffset = 50,
                AllowSwiping = true,
                ItemsSource = listModel,
            };
            Content = new StackLayout {
                Spacing = 0,
Children = {
                    lv
                }
};

            lv.SwipeStarted += Lv_SwipeStarted;
            lv.SwipeEnded += Lv_SwipeEnded;

        private void Lv_SwipeEnded(object sender, SwipeEndedEventArgs e)
        {
            ItemIndex = e.ItemIndex;
        }

        private void Lv_SwipeStarted(object sender, SwipeStartedEventArgs e)
        {
            ItemIndex = -1;
            if (e.SwipeDirection == SwipeDirection.Right)
            {
                e.Cancel = true;
            }
            var item = (hMSG001ListViewCellBase)e.ItemData;
            if (item.Channel == MSGChannelType.Hang)
            {
                lv.SwipeOffset = 100;
            }
            else
            {
                lv.SwipeOffset = 50;
            }
        }


Syncfusion.Xamarin.SfListView = 14.4.0.20
Xamarin.Forms = 2.3.3.180

Dinesh Babu Yadav [Syncfusion]
Replied On January 25, 2017 10:23 AM UTC

Hi Huhu,   
   
Thank you for using Syncfusion product.   
  
We have checked the reported issue “Swiping is not responsive in iOS platform” at our end, but we were unable to reproduce the issue with our sample. Could you please check with the below sample? If the issue still reproduces at your end, we suspect that problem might be occurred in your side because of your ItemTemplate. So please modify the sample with your ItemTemplate to reproduce the issue and update us with replication procedure or video link. So, that we could able to analyze the issue better and update you with appropriate solution.   
  
 
In the above sample, SwipeStarted event is triggered both in Release and Debug mode as excepted. We have ensured it by adding a DisplayAlert call into the SwipeStarted event like below example and the corresponding DisplayAlerts are raised when SwipeStarted event is fired.  
  
Code example[C#]: 
private void ListView_SwipeStarted(object sender, SwipeStartedEventArgs e) 
{ 
   DisplayAlert("Swipe Started", "Swiping item is" + (e.ItemData as ListViewInboxInfo).Title, "Ok"); 
 
   itemIndex = -1; 
 
   if (e.SwipeDirection == SwipeDirection.Right) 
       e.Cancel = true; 
 
} 
 
Please let us know if you require further assistance. 
 
Regards, 
Dinesh Babu Yadav 
 


Damian Hadjinicolaou
Replied On April 21, 2017 07:32 AM UTC

Hi Dinesh,

I seem to be having the same issue.

I downloaded your sample.

While it works fine in the simulator, when I try running it on a physical device, I have trouble getting it to fire the swipe event.

I get it very occasionally.

I feel like it may be something to do with the CustomViewCell possibly blocking the input, and that I may be just catching the background when it actually fires.

Running iPhone 7 on 10.3.1.

Damian

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;