Span Label underline is not working on Xamarin iOS

Nilesh Vernekar 0 Reputation points
2023-08-04T15:41:21.5933333+00:00

I'm using a Label with Spans, one of them is a link and I want to add an underline style, I'm using <Span Text="{Binding AcceptTermsAndConditionText[1]}" TextDecorations="Underline" /> but it is not working in iOS with "Xamarin.Forms" Version="5.0.0.2401".

I have tried to add an effect but all the properties needs to be set again (Styles, touch events, etc...).

<Label>
    <Label.FormattedText>
        <FormattedString>
            <Span Text="Text 1"/>
            <Span Text="Text 2"/>
            <Span Text="Click to open Link" TextDecorations="Underline">
                <Span.GestureRecognizers>
                    <TapGestureRecognizer Command="{Binding lINKCommand}"/>
                </Span.GestureRecognizers>
            </Span>
        </FormattedString>
    </Label.FormattedText>
</Label>
Developer technologies .NET Xamarin
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.