-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] iOS label can't un-set text decorations when updating text at the same time #11954
Comments
To work around this issue: xamarin/Xamarin.Forms#11954
Maybe I've a related bug. I have a Label using TextDecorations.Underline and when I change the text then a can't remove the underline anymore. But if I doesn't change the text, I can control the TextDecorations normally. |
I have same problem in Android. I am using Xamarin.Forms" Version="4.8.0.1364". |
I found a dirty bypass solution of this.
this is a sample code
Of course, you can write better code than this simple code I wrote. Hope you use it well. The regrettable thing I think while using Xamarin is that many functions that I expect to work naturally do not work properly. So I spend a lot of time implementing such a bypass workaround, and the codebase is getting bigger. Of course, you'll be busy spending a lot of time solving a lot of high-priority tasks, but I think that if there is no guarantee that someday these trivial problems will be solved, I might give up on Xamarin and move on to other frameworks or native development. I am sorry to say this without even contributing to this. |
This comment has been minimized.
This comment has been minimized.
Any updates on this issue? |
Workaround: Use Label.FormattedText instead of Label.Text |
Hey everyone, I know it's been a while, thanks for your patience. I have a PR out for this, you can find it at (#14907) if anyone is still willing or able to test this, please follow these instructions. Since the Label is a widely used control I would want to test this very well to make sure this doesn't break anything. Please let me know, thanks! :) |
Description
On iOS specifically, un-setting TextDecoration (such as removing StrikeThrough) is a no-op when the Text is updated at the same time. Android works fine. It's probably not just the Text property but it does repro that way.
Steps to Reproduce
TextDecoration=TextDecorations.Strikethrough
.TextDecoration=TextDecorations.None
.If you DON'T change the label's text at the same time, then it works (strikethrough will get set, and then un-set).
Possibly related, but unsure:
Expected Behavior
Label's text should change every time, and the text decorations should change every time
Actual Behavior
Label's text changes but the strikethrough style never un-sets (it always stays as Strikethrough). Same happens with Underline.
Basic Information
Screenshots
Repro code
Start with basic XAML app.
Use this XAML in the MainPage:
And this C# for MainPage's codebehind:
Workaround
Unknown
The text was updated successfully, but these errors were encountered: