UISwitch修改大小的和关闭打开的颜色

2019-07-09  本文已影响0人  guoguojianshu

UISwitch不能修改大小,只能设置缩放

        _swith.transform = CGAffineTransformMakeScale(0.8, 0.8);

tintColor设置这个颜色,只是对外观进行设置,但是里面的背景色不起作用

        _swith.onTintColor = UIColorMakeWithHex(@"#F54440");
        _swith.tintColor =  UIColorMakeWithHex(@"#EBEBEB");
        _swith.backgroundColor =  UIColorMakeWithHex(@"#EBEBEB");
        _swith.layer.cornerRadius = 15;
        _swith.layer.masksToBounds = YES;
        _swith.transform = CGAffineTransformMakeScale(0.8, 0.8);
上一篇 下一篇

猜你喜欢

热点阅读