Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set UISwitch border color?

My app has:

[[UIView appearance] setTintColor:[UIColor whiteColor]];

And here is what I have when on:

switch in on position

and off:

switch in off position

I need to make UISwitch border visible like in Settings.app:

Settings app

like image 517
k06a Avatar asked Feb 22 '14 19:02

k06a


1 Answers

Your [[UIView appearance] setTintColor:[UIColor whiteColor]]; is interfering with the tint color of your switch. The command to set the tint color is self.mySwitch.tintColor = [UIColor grayColor]; which sets the color used to tint the outline of the switch when it is turned off.

like image 194
sangony Avatar answered Sep 29 '22 14:09

sangony