UIKit - UISwitch
2022-08-22 本文已影响0人
ienos
修改不同状态下的颜色
/// 开启状态
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