Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 改变边界厚度?_Ios_Uiswitch - Fatal编程技术网

Ios 改变边界厚度?

Ios 改变边界厚度?,ios,uiswitch,Ios,Uiswitch,我正在项目中使用UISwitch,并已使用switch.tintColor成功更改边框的颜色。但是,笔划有点粗-有没有办法更改UI开关上此边框的宽度?嗨,您可以设置开关的图层边框,这样可以为您提供所需的自定义: switch.layer.borderWidth = 1.0; switch.layer.cornerRadius = 16.0; switch.layer.borderColor = [UIColor whiteColor].CGColor; 有趣的问题。我需要相同的,但不能这样做=

我正在项目中使用UISwitch,并已使用
switch.tintColor
成功更改边框的颜色。但是,笔划有点粗-有没有办法更改UI开关上此边框的宽度?

嗨,您可以设置开关的图层边框,这样可以为您提供所需的自定义:

switch.layer.borderWidth = 1.0;
switch.layer.cornerRadius = 16.0;
switch.layer.borderColor = [UIColor whiteColor].CGColor;

有趣的问题。我需要相同的,但不能这样做=(您解决了这个问题吗?欢迎使用StackOverflow编辑器工具为您提供beter look答案