Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Tap gesture on a stacklayout fires for each of the child views. Is there a fix for this?

$
0
0

//I know the code can be more elegant - just for explanation purposes
//Showmenu() fires for as many Labels as I put in the stack (Android and iOS). It is a shared project. Forms 3.6.0.293080

            for (int ii = 0; ii < someCount; ii++)
            {
        aSL = new StackLayout();
                    aSL.Children.Add(new Label { Text="One"});
        aSL.Children.Add(new Label { Text="Two"});
        aSL.Children.Add(new Label { Text="Three"});
                    aSL.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => { showMenu(); }) });
        ViewCell vc = new ViewCell { View = aSL};
                aSection.Add(vc);
            }

//aSection is a section in a TableView


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>