【发布时间】:2015-02-04 01:48:28
【问题描述】:
我在我的项目中使用了 UISwitch,并已使用 switch.tintColor 成功更改了边框的颜色。不过笔画有点粗——有没有办法改变UISwitch上这个边框的宽度?
【问题讨论】:
-
有趣的问题。我需要同样的,但不能这样做=(你解决了这个问题吗?
我在我的项目中使用了 UISwitch,并已使用 switch.tintColor 成功更改了边框的颜色。不过笔画有点粗——有没有办法改变UISwitch上这个边框的宽度?
【问题讨论】:
您好,您可以设置开关的图层边框,这将为您提供所需的自定义,如下所示:
switch.layer.borderWidth = 1.0;
switch.layer.cornerRadius = 16.0;
switch.layer.borderColor = [UIColor whiteColor].CGColor;
【讨论】: