Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kubaflo committed Jan 14, 2025
1 parent 24950f4 commit d7097fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/Core/src/Handlers/Label/LabelHandler.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,11 @@ public static void MapFormatting(ILabelHandler handler, ILabel label)
// so we need to make sure those are applied, too
handler.UpdateValue(nameof(ILabel.HorizontalTextAlignment));
}

internal static void ReapplyFormattingForHTMLLabel(ILabelHandler handler, ILabel label)
{
handler.UpdateValue(nameof(ILabel.TextColor));
handler.UpdateValue(nameof(ILabel.Font));
}
}
}
6 changes: 2 additions & 4 deletions src/Core/src/Platform/iOS/LabelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,8 @@ internal static void UpdateTextHtml(this UILabel platformLabel, ILabel label)
{
platformLabel.AttributedText = new NSAttributedString(text, attr, ref nsError);
if (label.Handler is ILabelHandler labelHandler)
{
labelHandler.UpdateValue(nameof(ILabel.TextColor));
labelHandler.UpdateValue(nameof(ILabel.Font));
}
LabelHandler.ReapplyFormattingForHTMLLabel(labelHandler, label);

label.InvalidateMeasure();
});
}
Expand Down

0 comments on commit d7097fd

Please sign in to comment.