question

10918804 avatar image
0 Votes"
10918804 asked ColeXia-MSFT answered

Dark Mode with Label when TextType is Html

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


dotnet-xamarinforms
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ColeXia-MSFT avatar image
0 Votes"
ColeXia-MSFT answered

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.



2.png (34.7 KiB)
capture.png (38.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.