How to set UISwitch border color?

后端 未结 3 1114
星月不相逢
星月不相逢 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:49

    Rather than using the appearance proxies you can also use:

    [self.mySwitch setThumbTintColor:[UIColor blueColor]];
    [self.mySwitch setOnTintColor:[UIColor redColor]];
    

    ie. Use setOnTintColor for the background/border color.

提交回复
热议问题