eBay/NMessenger

How to round Image in Avatar?

Opened this issue · 1 comments

Here is my code:

private func createAvatar()->ASImageNode {
let avatar = ASImageNode()
avatar.backgroundColor = UIColor.lightGray
let side: CGFloat = 40
avatar.style.preferredSize = CGSize(width: side, height: side)
avatar.image = UIImage(named: "cartoon_chick")
avatar.layer.cornerRadius = side/2
return avatar
}

Even though I set value to cornerRadius my avatar images still square. How to fix it?

@dannogo , here is the solution facebookarchive/AsyncDisplayKit#90
Please close this issue.

P.S.
It's rather an AsyncDisplayKit question and it is not related to NMessenger
Please take time googling and reading manuals next time.