Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

How to round Image in Avatar? #175

Open
dannogo opened this issue Nov 15, 2017 · 1 comment
Open

How to round Image in Avatar? #175

dannogo opened this issue Nov 15, 2017 · 1 comment

Comments

@dannogo
Copy link

dannogo commented Nov 15, 2017

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?

@dodikk
Copy link

dodikk commented Nov 15, 2017

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants