In order to get the position of touch, you have to create a custom renderer for page. Here's an example :
public class ExtendedContentPageRenderer : PageRenderer
{
private ExtendedContentPage _thePage;
private UITapGestureRecognizer _tapGestureRecognizer;
public ExtendedContentPageRenderer()
{
_tapGestureRecognizer = new UITapGestureRecognizer(a => UITapGestureRecognizerHandler(a))
{
ShouldRecognizeSimultaneously = (recognizer, gestureRecognizer) => true,
ShouldReceiveTouch = (recognizer, touch) => true,
};
_tapGestureRecognizer.DelaysTouchesBegan = _tapGestureRecognizer.DelaysTouchesEnded = _tapGestureRecognizer.CancelsTouchesInView = false;
}
private void UITapGestureRecognizerHandler(UITapGestureRecognizer gestureRecog)
{
if (gestureRecog.State == UIGestureRecognizerState.Ended)
{
var endPos = gestureRecog.LocationOfTouch(0, gestureRecog.View);
_thePage.TriggerTouchDown(endPos.X, endPos.Y);
}
}
protected override void OnElementChanged(VisualElementChangedEventArgs e)
{
if (e.OldElement != null)
{
View.RemoveGestureRecognizer(_tapGestureRecognizer);
_thePage = null;
}
if (e.NewElement != null)
{
_thePage = e.NewElement as ExtendedContentPage;
View.AddGestureRecognizer(_tapGestureRecognizer);
}
base.OnElementChanged(e);
}
}
As you can see, I've created a custom page for propagating back the touch event to the main page. In the page you could then see if the touch coordinates passed lies withing the bounds of the image view in consideration.