Closed SangI762 closed 2 years ago
The UIButton on iOS already consumes some events so that not everything works in MR.Gestures. See https://www.mrgestures.com/#Compatibility
Now iOS handles touch gestures for the UIButton, Xamarin handles it for the Click event, MR.Gestures adds some UIGestureRecognizers and you add some Touch* events. This is too much.
Please use a MR.Gestures.Button with the MR.Gestures events instead. It may also help to replace the XF.Button with a MR.Gestures.Label (or any other control) so that the underlying UIButton is removed.
Yes, you're right, but it doesn't explain why 2.0.0 works with that and 2.1.0 don't. I'm interesting what was changed in MR.Gestures.ContentView.
Also, can I disable MR double tap events somehow? Because MR TappedCommand start is slower than XF element with TapGestureRecognizer.
In 2.1.0 I fixed the bug that the PanEventArgs are empty when Panning is first raised although the finger has already been moved. For this I needed to add my custom DownUpGestureRecognizer not only for handling Down and Up, but also if Panning or Panned is handled.
All other changes are not related to how gestures are detected on iOS.
You can disable double tap events by unsubscribing from the event.
Does this mean we cannot use custom buttons for iOS?
Looks like. I reverted to 2.0.0. I don’t want rewrite my custom button which is used for entire app. Our app has 100+ k users and everything works as expected. But new version has breaking changes :(
Does this mean we cannot use custom buttons for iOS?
Of course you can. Just use the MR.Gestures event handlers and not the iOS ones. MR.Gestures was made to abstract away the gesture handling so that you don't need to know how that is done on each and every platform. The goal is that you don't need a custom renderer at all just for gesture handling.
I don't know why the iOS controls behave differently when you add a UIGestureRecognizer to them. But if what you say is true, then this is the only explanation I have. This seems to be an unexpected side effect in iOS. I cannot change it.
If you know another way to get the starting position of a touch from a UIPanGestureRecognizer, then I could remove the additional UIGestureRecognizer I needed to add for that. But I don't know if that's possible.
I have my custom button in MR.Gestures.ContentView which has those events in iOS button renderer:
With 2.1.0 only TouchDown is raised. Reverted to 2.0.0 is raised TouchDown and TouchUpInside as expected. So my button just stop working. MR.Gestures.ContentView subscribes: Panning, Panned, DoubleTapped events. Any thoughts?