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. Image for the cookie policy date
close icon

Can't Swipe on SfListView at iOS

hello:
I Can't Swipe on SfListView  at iOS

4 Replies

EM Emil January 24, 2017 03:04 PM UTC

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


HU huhu 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


DB Dinesh Babu Yadav Syncfusion Team 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 
 



DH Damian Hadjinicolaou 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

Loader.
Live Chat Icon For mobile
Up arrow icon