How do I make a UISwitch under iOS 7 not take the background colour of the view behind it?

后端 未结 6 426
终归单人心
终归单人心 2021-02-02 11:27

It looks like this whenever off:

\"enter

While I\'d prefer more of a grey backgrou

6条回答
  •  感情败类
    2021-02-02 11:53

    You can also set this for the switch in Interface Builder. Just set the background colour of the UISwitch to whatever colour you want (white, in the example below), then set a User Defined Runtime Attribute of layer.cornerRadius = 16:

    enter image description here

提交回复
热议问题