Code: Select all
let pointsView = UIView()
pointsView.layer.cornerRadius = 20
pointsView.backgroundColor = .white
pointsView.layer.borderColor = UIColor.gray.cgColor
pointsView.layer.borderWidth = 1
pointsView.layer.masksToBounds = true
pointsView.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(pointsView)
< /code>
Ich versuche, PunkteView abgerundete Ecken wie das Bild zu geben, aber es funktioniert nicht. Die Ecken erscheinen rechteckig anstatt dem Bild, das angehängt ist. < /P>
Kann jemand helfen. https://i.sstatic.net/3gfro26l.jpg "/>
Ich habe es versucht,
pointsView.layer.cornerRadius = 20