只有底角是圆的

Only bottom corners rounded

我在 tableView 下方有一个 textview,两者的背景颜色相同,因此它看起来就像是一个 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

我的工作代码只需检查您添加的约束。

        let maskPath: UIBezierPath = UIBezierPath(roundedRect: self.button.bounds, byRoundingCorners: ([.BottomLeft, .BottomRight]), cornerRadii: CGSizeMake(10.0, 10.0))
        let maskLayer: CAShapeLayer = CAShapeLayer()
        maskLayer.frame = self.button.bounds
        maskLayer.path = maskPath.CGPath
        self.button.layer.mask = maskLayer