Saturday, February 10, 2024
HomeiOS Developmentios - Shade in UISwitch monitor

ios – Shade in UISwitch monitor


I’ve a UISwitch to which I’m customising the thumb and monitor colour.

if (locationTrackingSwitch.On)
    locationTrackingSwitch.ThumbTintColor = FromHEX(theme.colorInput);
else
    locationTrackingSwitch.ThumbTintColor = FromHEX(theme.colorButton);
locationTrackingSwitch.Layer.CornerRadius = (nfloat)(locationTrackingSwitch.Body.Peak / 2.0);
locationTrackingSwitch.BackgroundColor = UIColor.Black; //FromHEX(theme.colorInput);
locationTrackingSwitch.OnTintColor = FromHEX(theme.colorButton);

If the background colour is Black, it reveals black within the monitor like in pic Black-Background

But when the background colour is white as in

locationTrackingSwitch.BackgroundColor = UIColor.White; 
//FromHEX(theme.colorInput);` 

It reveals grey color monitor as a substitute of white as in

White-Background.

I’m not understanding why the white colour shouldn’t be seen. It really works high quality with every other colour. Additionally, the identical white colour reveals high quality with the thumb within the “On” state.
(theme.ColorInput is white colour, “#ffffff”)



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments