How do I make an UIImage/-View with rounded corners CGRect (Swift)

前端 未结 8 2522
你的背包
你的背包 2020-12-13 01:47

How do I make a UIImageView with rounded corners on a Swift iOS Playground?
Inside it needs to be filled with a color.

8条回答
  •  盖世英雄少女心
    2020-12-13 02:13

    Try this, it worked for me.

    self.profileImageView.layer.cornerRadius = self.profileImageView.frame.size.width / 2
    self.profileImageView.clipsToBounds = true
    

提交回复
热议问题