tag:blogger.com,1999:blog-4719570307035103606.post6799945928360123282..comments2023-10-27T08:40:12.426+01:00Comments on Smart Mobile Device: Xamarin.Forms ListView Drag and Drop to ReorderPaul Distonhttp://www.blogger.com/profile/06408320974678068440noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-4719570307035103606.post-51513941791189718412017-08-11T22:03:53.249+01:002017-08-11T22:03:53.249+01:00Did you ever do an iOS implementation of this? Did you ever do an iOS implementation of this? Ryanhttps://www.blogger.com/profile/06924075678966341236noreply@blogger.comtag:blogger.com,1999:blog-4719570307035103606.post-6093876306400013292017-03-16T02:29:03.758+00:002017-03-16T02:29:03.758+00:00it is works more than 25 rows. but, index is wrang...it is works more than 25 rows. but, index is wrang.<br /><br />so, I fixed source code by:<br /><br />MyViewCellRenderer.cs Line 57<br /><br />// FirstIndex = ListView.IndexOfChild(ViewGroup.Parent as View);<br />FirstIndex = ListView.GetPositionForView(ViewGroup.Parent as View);<br /><br />and Line 72<br /><br />// SecondIndex = ListView.IndexOfChild(ViewGroup.Parent as View);<br />SecondIndex = ListView.GetPositionForView(ViewGroup.Parent as View);<br /><br />益銘https://www.blogger.com/profile/11093971904970869088noreply@blogger.comtag:blogger.com,1999:blog-4719570307035103606.post-89116847491482690042017-01-23T19:17:08.315+00:002017-01-23T19:17:08.315+00:00This is working great in my Droid project, but the...This is working great in my Droid project, but the ItemLongClick event is overriding the ContextActions defined in my Xamarin.Forms page. If I comment out the Control.ItemLongClick += OnItemLongClick line, the Android context menu shows just fine. <br /><br /><br />On iOS, dragging a cell to the side displays the context action menu items. And in Android, if I do not have the Control.ItemLongClick, it, too, displays the context menu as expected. <br /><br />In the DraggableListViewRenderer I implemented based on your code, I added:<br /><br /><br />public override bool OnInterceptTouchEvent(MotionEvent ev)<br />{<br />_x = ev.RawX;<br />_y = ev.RawY;<br />return base.OnInterceptTouchEvent(ev);<br />}<br /><br />And in OnItemLongClick, I've added a test in ItemLongClick to only start the drag if the touch event is x < 100, which is where I've placed a drag image. Somehow the event handler overrides the ability to display the context menu.Anonymoushttps://www.blogger.com/profile/13417021392211224901noreply@blogger.comtag:blogger.com,1999:blog-4719570307035103606.post-82047834173981574852017-01-23T19:15:09.854+00:002017-01-23T19:15:09.854+00:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/13417021392211224901noreply@blogger.comtag:blogger.com,1999:blog-4719570307035103606.post-79082656859837564672016-10-28T19:21:38.059+01:002016-10-28T19:21:38.059+01:00HI,
Thank for your help!Actually I used your sourc...HI,<br />Thank for your help!Actually I used your source code but the thing is ,its not working while lots of data , lets add some 25 data and try to swap ,it will not workDamnhansyhttps://www.blogger.com/profile/04885968649211928925noreply@blogger.com