How to change the default color(blue) of a UISwitch?
You can use the tintColor property on the switch. Setting tintColor in iOS7 removes "outline" for me (tint white against white background).
There is no way to change the tint color of Toggle from SwiftUI, but we can use UIAppearance API from UIKit to set the tint color for all UISwitch instances across the app. You can paste this line in AppDelegate to configure the color before you create a view.
I think what you are looking for is something like this
UISwitch *testSwitch; //just something I made up [testSwitch setOnTintColor:[UIColor greenColor]];
In Xcode 5 and iOS 7 it's now in the attributes inspector:
Changing the On Tint will change the button's color when it's turned on.
I hope that's what you were looking for! Even though you posted that question like three years ago.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With