Round UIImage disappear

时间:2015-06-30 13:49:38

标签: swift

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

1 个答案:

答案 0 :(得分:0)

将此行添加到可行的布局中。

 self.avatarImageView.layoutIfNeeded()