Hi there
What can be wrong with the following code:
public Action Click;
...
sl = new StackLayout();
...
img = new Image();
img.HeightRequest = 48;
img.WidthRequest = 48;
var tapGestureRecognizer = new TapGestureRecognizer();
tapGestureRecognizer.Tapped += (s, e) =>
{
if (Click != null) Click();
};
img.GestureRecognizers.Add(tapGestureRecognizer);
sl.Children.Add(img);
Image appears on the screen but if I tap on it, tapGestureRecognizer.Tapped never fires.
How to fix it?
Thanks.