xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

[Bug][iOS] TextDecorations property does not work on Span on iOS #15314

Open SamuelLioult opened 2 years ago

SamuelLioult commented 2 years ago

Description

I need to underline some pieces of text. For this I use Spans with the TextDecorations property giving it the value Underline. It worked fine on version 5.0.0.2125. Now I'm working on version 5.0.0.2401 and it doesn't work anymore.

Steps to Reproduce

  1. Create a project with Xamarin Forms 5.0.0.2125
  2. Create a Label with a FormattedText containing Spans with the TextDecorations Underline value
  3. Launch your app -> The text is underlined
  4. Upgrade to Xamarin Forms 5.0.0.2401
  5. Launch the app again -> The text is not underlined

Expected Behavior

The text is underlined.

Actual Behavior

The text is not underlined.

Basic Information

beeradmoore commented 2 years ago

Had just come here to post this and it was reported just 13 hours ago 😂

bradlak commented 2 years ago

I also need it.

djhango commented 2 years ago

Also seeing this issue on XF 5.0.0.2337

Hooterr commented 2 years ago

Still doesn't work on iOS XF 5.0.0.2401 @jfversluis this is quite important for people who have apps in production.

de-preut commented 2 years ago

we are also affected by this. Is there a work-a-round available?

SamuelLioult commented 2 years ago

Unfortunately there doesn't seem to be a work around. @jfversluis, could you take a look at it please? It seems that many of us are bothered by this problem. If not, could you at least inform us if this bug is not planned to be studied because it is considered minor by the team.

martinhellwig commented 2 years ago

Hi @SamuelLioult: We have the same problem (underline does not work for Span inside FormattedString on iOS). Following tip works for us: https://stackoverflow.com/questions/72121135/span-label-underline-is-not-working-on-xamarin-ios

We simply call a DataTrigger-variable 100ms after the page was initialized. Hope this helps

softsan commented 2 years ago

This is an old post but it works for me: https://theconfuzedsourcecode.wordpress.com/2016/03/10/so-i-created-this-awesomehyperlinklabel-custom-renderer-control-one-day-for-xamarin-forms/ It actually cover phone number and email as well apart from hyperlink. So it is more useful IMO.

bitshftr commented 2 years ago

I'm also seeing this problem in XF 5.0.0.2291.

SamuelLioult commented 2 years ago

@martinhellwig Thank you for this workaround. This issue is still present in XF 5.0.0.2515. Anyone know if it is also present in early versions of MAUI?

carbonete commented 1 year ago

This issue is still present in Xamarin.Forms Version="5.0.0.2612" Any news ?