How to set UISwitch border color?

后端 未结 3 1068
星月不相逢
星月不相逢 2021-02-19 09:11

My app has:

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

And here is what I have when on:

and off

3条回答
  •  青春惊慌失措
    2021-02-19 09:52

    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.

提交回复
热议问题