I set my image works well like this:
self.avatarImageView.image = self.avatarImage
But, when i want to change it to circle in this way the image disappear.
self.avatarImageView.layer.masksToBounds = true
self.avatarImageView.image = self.avatarImage
self.avatarImageView.layer.cornerRadius = self.avatarImageView.frame.width/2
答案 0 :(得分:0)
将此行添加到可行的布局中。
self.avatarImageView.layoutIfNeeded()