Xamarin.Forms icon indicating copy to clipboard operation
Xamarin.Forms copied to clipboard

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

Open SamuelLioult opened this issue 2 years ago • 11 comments

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

  • Version with issue: 5.0.0.2401
  • Last known good version: 5.0.0.2125 (I have not tried with all intermediate versions)
  • Platform Target Frameworks:
    • iOS: 15.3.1 / 15.4
    • Android: works well on Android

SamuelLioult avatar Apr 15 '22 13:04 SamuelLioult

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

beeradmoore avatar Apr 16 '22 03:04 beeradmoore

I also need it.

bradlak avatar May 02 '22 09:05 bradlak

Also seeing this issue on XF 5.0.0.2337

djhango avatar Jun 01 '22 03:06 djhango

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

Hooterr avatar Jun 02 '22 09:06 Hooterr

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

de-preut avatar Jun 29 '22 07:06 de-preut

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.

SamuelLioult avatar Jul 06 '22 09:07 SamuelLioult

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

martinhellwig avatar Jul 07 '22 10:07 martinhellwig

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.

softsan avatar Jul 08 '22 18:07 softsan

I'm also seeing this problem in XF 5.0.0.2291.

bitshftr avatar Aug 22 '22 20:08 bitshftr

@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?

SamuelLioult avatar Sep 28 '22 12:09 SamuelLioult

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

carbonete avatar Sep 29 '23 18:09 carbonete