나는 사지 또는 사변형과 같은 이미지를 만들고 싶습니다 enter image description here. 사다리꼴에 이미지를 놓습니다.Trapezium과 같은 Imageview를 만드는 방법
let path = UIBezierPath()
path.move(to: CGPoint(x: 0, y: 0))
path.addLine(to: CGPoint(x: view.bounds.width, y: 0))
path.addLine(to: CGPoint(x: self.view.bounds.width, y: self.view.bounds.height/2 - 60)) // 50
path.addLine(to: CGPoint(x: 0, y: view.bounds.size.width - 85)) // 80
path.close()
let shapeLayer = CAShapeLayer()
shapeLayer.path = path.cgPath
shapeLayer.fillColor = UIColor.black.cgColor
shapeLayer.strokeColor = UIColor.black.cgColor
view.layer.mask = shapeLayer
당신이 시도한 것을 보여주십시오. 우리는 당신을 위해 코드를 작성하지 않습니다. – Retterdesdialogs
마스크 레이어와 UIBezierPath를 사용하십시오. (이처럼 간단한 폼에서는 꽤 쉬워야합니다). – Larme
한번 시도하지 않고도이를 수행 할 수는 없으므로 도움을 청하십시오. –