You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added custom gesture recognizer,. I did override the TouchesEnded method.
What did you expect to happen?
TouchesEnded to be fired after I finished swiping finger on the chart (with highlighting enabled)
What happened instead?
TouchesEnded was never called after swiping end, only if it was a tap. I suppose it shall happen after swiping as well, since there are no other methods to override for swipe ending.
Charts Environment
I am on master, latest.
latest
latest
iOS
latest
The text was updated successfully, but these errors were encountered:
After a funny journey on the github and stackoverflow I got answer to my question.
I found that BarLineChartViewBase adds NSUIPanGestureRecognizer, and after adding mine as well, made it not to draw the highlighter so I had to call the func of BarLineChartViewBase named panGestureRecognized but it was not public. And I am on Xamarin.iOS I had to do some reflection for objective C and c# and here is the code
var list = Control.GestureRecognizers.ToList();
var old = list.First(x => x is UIPanGestureRecognizer);
list.Remove(old);
var our = (new UIPanGestureRecognizer(uIPanGestureRecognizer =>
{
ObjCRuntime.Selector selector = new ObjCRuntime.Selector("panGestureRecognized:");
var theStaticClassType = typeof(UIView).Assembly.GetType("ObjCRuntime.Messaging");
MethodInfo staticMethodInfo = theStaticClassType.GetMethod("void_objc_msgSend_IntPtr");
staticMethodInfo.Invoke(this, new object[] { Control.Handle, selector.Handle, uIPanGestureRecognizer.Handle });
if (uIPanGestureRecognizer.State == UIGestureRecognizerState.Ended)
{
//code that happens when swipe ends
}
}));
list.Add(our);
Control.GestureRecognizers = list.ToArray();
Where Control is LineChartView. I used this in custom renderer for Xamarin.Forms and it works fine
What did you do?
I added custom gesture recognizer,. I did override the TouchesEnded method.
What did you expect to happen?
TouchesEnded to be fired after I finished swiping finger on the chart (with highlighting enabled)
What happened instead?
TouchesEnded was never called after swiping end, only if it was a tap. I suppose it shall happen after swiping as well, since there are no other methods to override for swipe ending.
Charts Environment
I am on master, latest.
latest
latest
iOS
latest
The text was updated successfully, but these errors were encountered: