【发布时间】:2016-04-15 11:37:27
【问题描述】:
我在 tableView 下方有一个 textview,两者的 Backgroundcolor 相同,因此看起来好像是一个 View。现在我希望 textview 的底角是圆角的,而不是顶部的(因为你可以看到 textview 和 tableview 之间的间隙)。我在这里找到了一些答案,但不知怎的,它只是让左下角变圆,而不是右下角?我还尝试更改数组内的顺序,但没有奏效。然后我尝试了左角,工作。但是只有右边的角落不起作用?!这是我目前所拥有的
let rectShape = CAShapeLayer()
rectShape.bounds = self.eventDescription.frame
rectShape.position = self.eventDescription.center
rectShape.path = UIBezierPath(roundedRect: self.eventDescription.bounds, byRoundingCorners: [.BottomLeft, .BottomRight], cornerRadii: CGSize(width: 20, height: 20)).CGPath
self.eventDescription.layer.mask = rectShape
【问题讨论】:
-
可能是因为你通过了
byRoundingCorners: [.BottomLeft, .BottomRight]? -
是的,但我也只尝试了 byRoundingCorners: .BottomLeft 效果很好,但是 byRoundingCorners: .BottomRight 没有做任何事情
标签: ios swift textview rounded-corners