Dark Mode with Label when TextType is Html

jrahma 111 Reputation points
2021-03-25T21:05:44.653+00:00

Hi,

How can I set the Dark Mode for a Label when the TextType is Html?

Here is my Dark Mode:

<Style x:Key="Labels" TargetType="Label">  
    <Setter Property="BackgroundColor" Value="{AppThemeBinding Light=#ffffff, Dark=#121212}" />  
    <Setter Property="TextColor" Value="{AppThemeBinding Light=#000000, Dark=#ffffff}" />  
</Style>  

and this my Label:

81673-screen-shot-2021-03-26-at-10737-am.png

Thanks,
Jassim

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,292 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Cole Xia (Shanghai Wicresoft Co,.Ltd.) 6,751 Reputation points
    2021-03-26T02:05:59.33+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Dark Mode works as expected in my test .

    Light mode

    81741-2.png

    Dark mode

    81715-capture.png

    However, we should not specify background color or text color in html , it will override the setting in style .


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments