私は台形または四辺形のようなイメージを作りたいenter image description here。そして、TrapeziumのImageを設定します。私たちは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
一度も実行しないとこれを行うことはできません。より良いヘルプのためにコミュニティと試してみてください。 –