修改不同状态下的颜色
/// 开启状态
switch.onTintColor = onColor
/// 关闭状态
switch.tintColor = offColor
switch.layer.cornerRadius = switch.frame.height / 2.0
switch.backgroundColor = offColor
switch.clipsToBounds = true
/// 开启状态
switch.onTintColor = onColor
/// 关闭状态
switch.tintColor = offColor
switch.layer.cornerRadius = switch.frame.height / 2.0
switch.backgroundColor = offColor
switch.clipsToBounds = true
本文标题:UIKit - UISwitch
本文链接:https://www.haomeiwen.com/subject/mifngrtx.html
网友评论