ios - Attempting to mask a circle around an image not working -


i have image attempting mask circle around image appears round. works circle comes point on top , bottom.

profileimageview.layer.cornerradius = profileimageview.frame.size.width/2; profileimageview.layer.maskstobounds = yes; 

should code drawing perfect circle? seems draw circle in 1 place in 2 other places, not working correctly.

i have had best results masking image view cashapelayer:

cgfloat radius = self.profileimageview.frame.size.width / 2.0; uibezierpath *path = [uibezierpath bezierpathwitharccenter:cgpointmake(radius, radius) radius:radius startangle:0 endangle:m_pi * 2.0 clockwise:true]; cashapelayer *layer = [cashapelayer layer]; layer.path = path.cgpath; layer.linewidth = 0; self.profileimageview.layer.mask = layer; 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -