我已附上图片。我想创建UIVIEW的拐角半径。请查看图片https://i.stack.imgur.com/AkUuO.png
希望这会有所帮助:
let redBox = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
redBox.backgroundColor = .red
redBox.layer.cornerRadius = 25
redBox.layer.maskedCorners = [.layerMaxXMaxYCorner]
类似在这里问的类似问题:How to set cornerRadius for only top-left and top-right corner of a UIView?