Hello,
Label does not contain a Click event. If you need to click a Label to trigger an event, you need to use a tapgesture to implement it.
Please refer to the following code snippet and document.
var label = new Label
{
Padding = new Thickness(15),
TextColor = Color.FromArgb("#333"),
HorizontalOptions = LayoutOptions.Start,
FontSize = 19,
Text = "test"
};
TapGestureRecognizer tapGestureRecognizer = new TapGestureRecognizer();
tapGestureRecognizer.Tapped += (s, e) =>
{
// Handle the tap
};
label.GestureRecognizers.Add(tapGestureRecognizer);
flexLayout.Children.Add(label);
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.