maui icon indicating copy to clipboard operation
maui copied to clipboard

ThumbColor and OnColor property is not applied for switch

Open saiganesh-sakthivel opened this issue 1 year ago • 4 comments

Description

ThumbColor and OnColor property is not applied for switch. Unable to change the on/off text color in windows and also, unable the border of the switch.

image

Steps to Reproduce

MauiApp1NET8.zip

Link to public reproduction project repository

MauiApp1NET8.zip

Version with bug

8.0.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

saiganesh-sakthivel avatar Jan 31 '24 19:01 saiganesh-sakthivel

Same issue for me. The OnColor and ThumbColor properties of switch are not working. MAUI version 8.0.3 Untitled Screenshot_20240205-014551

Hrishikesh46779 avatar Feb 04 '24 20:02 Hrishikesh46779

Also. In the .NET 7 version everything worked, after updating to .NET 8 everything broke

K0Ma19 avatar Feb 07 '24 14:02 K0Ma19

I'm also having this issue with .NET 8. Additionally, I found that, if initial value is set to true, it will display the right colors upon loading, however after toggling off and and back on it reverts back to the same default colors. image image image

metmayhem avatar Feb 21 '24 15:02 metmayhem

Can repro this issue on the latest 17.10 preview 2(8.0.14) with the sample project.

QianaJiao avatar Mar 28 '24 05:03 QianaJiao

I applied this : https://github.com/dotnet/maui/issues/22373#issuecomment-2121899077 and my issue resolved.

nmpasdanis avatar May 22 '24 09:05 nmpasdanis

I applied this : #22373 (comment) and my issue resolved.

What XAML label did you apply exactly? I tried to remove the Switch style from the styles file, but I'm still having issues with the switch colors.

diescalo avatar Jul 19 '24 16:07 diescalo

I applied this : #22373 (comment) and my issue resolved.

What XAML label did you apply exactly? I tried to remove the Switch style from the styles file, but I'm still having issues with the switch colors.

I followed your assumption because I didn't understand what he meant either.

I commented out the style in the Styles.xaml and then the style I specified within the switch began working, using the visual state or the properties.

heribertolugo avatar Jul 29 '24 20:07 heribertolugo

What XAML label did you apply exactly? I tried to remove the Switch style from the styles file, but I'm still having issues with the switch colors.

I followed your assumption because I didn't understand what he meant either.

I commented out the style in the Styles.xaml and then the style I specified within the switch began working, using the visual state or the properties.

I couldn't make it work, so I ended up using this MAUI switch library: https://github.com/IeuanWalker/Maui.Switch

It works perfectly and has a lot of customization parameters.

diescalo avatar Jul 30 '24 07:07 diescalo

I applied this : #22373 (comment) and my issue resolved.

What XAML label did you apply exactly? I tried to remove the Switch style from the styles file, but I'm still having issues with the switch colors.

I followed your assumption because I didn't understand what he meant either.

I commented out the style in the Styles.xaml and then the style I specified within the switch began working, using the visual state or the properties.

Thanks, now it's working!

TheSundayDev avatar Sep 30 '24 17:09 TheSundayDev