Xamarin.forms: [Bug] [iOS] Label with HTML does not use applied text color

Created on 22 Oct 2019  路  5Comments  路  Source: xamarin/Xamarin.Forms

Description

The HTML is always black on iOS even if TextColor is set to white.

Steps to Reproduce

  1. Place a Label with HTML content and a different text color

Expected Behavior

Should display the text properly

Actual Behavior

Always black text color

Basic Information

  • Version with issue: 4.3
  • Last known good version: -
  • IDE: Latest stable VS for Mac Enterprise
  • Platform Target Frameworks:

    • iOS: Tested with iOS 13.1

Screenshots

The translator section is a Label with HTML content. It was previously correctly formatted with white text, centered and no misplaced characters. I was using the HtmlLabel plugin previously.
Simulator Screen Shot - iPhone 11 - 2019-10-22 at 21 39 30

Reproduction Link

Way too easy to reproduce to make a whole reproduction repo for it...

4 iOS 馃崕 bug

Most helpful comment

I can confirm that html text with no other coloring embedded in the value still shows up with black TNR style of text on iOS where it respects at least TextColor on android. as of 4.6. Makes the TextType = HTML on a label really pretty worthless.

All 5 comments

See also #8159, #8158, #8156

Repro project:

_8157 Repro.zip

I can confirm that html text with no other coloring embedded in the value still shows up with black TNR style of text on iOS where it respects at least TextColor on android. as of 4.6. Makes the TextType = HTML on a label really pretty worthless.

It affects font size as well as colour.

Xamrin.Forms: 4.6.0.800

So bumped everything up to 4.8.0.1238-pre3 in the Monkey CSS App in Xamrin samples

<Label TextType="Html" FontAttributes="Bold" FontSize="20" HorizontalTextAlignment="End" TextColor="Red" Text="4.8.0.1238-pre3" >

image

<Label TextType="Html" FontAttributes="Bold" FontSize="20" HorizontalOptions="Center" TextColor="Red" Text="4.8.0.1238-pre3" >

image

HorizontalTextAlignment is still not working in either XAML attribute or CSS class.

CDATA works well inside the XAML tag and setting HTML from code works as well

Was this page helpful?
0 / 5 - 0 ratings