locked
Is it possible to execute code on Span tap? RRS feed

  • Question

  • User139693 posted

    Is it possible to execute code when a specific part of a Label has been tapped? In this case the first span (full name).

    ```cs Label label = new Label { TextColor = Color.Black };

    FormattedString FormattedString = new FormattedString ();

    FormattedString.Spans.Add (new Span { Text = comment.from.full_name, FontAttributes = FontAttributes.Bold, ForegroundColor = Color.FromHex (App.ColorHex) });

    FormattedString.Spans.Add (new Span { Text = " " + comment.text });

    label.FormattedText = FormattedString; ```

    Monday, February 22, 2016 11:43 AM

Answers

  • User21272 posted

    This level of detail is not available :( Best bet is a gesture recognizer on a Label control and stacking separate labels to achieve the text you want to achieve.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, February 22, 2016 1:08 PM