Hi,
I have to drag an element in the page using custom renderer. I am currently referring the following link from XLabs.
I have tried running the above code. It works fine. But when I try to implement this in my solution I get a blank page.
So, is there any alternate solution to do drag and drop in Xamarin.forms using custom renderers.
You can use MR.Gestures to handle the Panning event of any control on your page. With the PanEventArgs passed to the event handler you can change the TranslationX and TranslationY of your button to drag it around. You can download an example how this can be done from https://github.com/MichaelRumpler/GestureSample.
There may be problems on iOS with a Button though. The native iOS button consumes the tap events. Your results may be better if you just use a Image instead of a Button.
Answers
Hello is there any solution on this ????
You can use MR.Gestures to handle the Panning event of any control on your page. With the PanEventArgs passed to the event handler you can change the TranslationX and TranslationY of your button to drag it around. You can download an example how this can be done from https://github.com/MichaelRumpler/GestureSample.
There may be problems on iOS with a Button though. The native iOS button consumes the tap events. Your results may be better if you just use a Image instead of a Button.
Thanks a lot!!!!