发现'setCornerRadius:'结果、参数类型或属性不匹配的多个命名方法



我尝试设置段的角半径

时会遇到此错误
[[self.daysSegment.subviews objectAtIndex:cnt] setCornerRadius:0];

命名为" setCornerradius:"的多种方法,与不匹配结果,参数类型或属性

发现

谢谢

尝试这个 -

[[(UIView*)[self.daysSegment.subviews objectAtIndex:cnt] layer] setCornerRadius:0];

编辑

我建议您超越代码。这将使调试变得更加容易。

UIView  *view  = [self.daysSegment.subviews objectAtIndex:cnt];
CALayer *layer = [view layer];
layer.cornerRadius = 0.0;

更改为

[[self.daysSegment.subviews objectAtIndex:cnt].layer setCornerRadius:0];

cornerradius在视图层上应用

((UIView*)[self.daysSegment.subviews objectAtIndex:cnt]).layer.cornerRadius = 0

最新更新