ios - Circular UIImageView in UITableView without performance hit? -
i have uiimageview
on each of uitableview
cells, display remote image (using sdwebimage
). i've done quartzcore
layer styling image view, such:
uiimageview *itemimageview = (uiimageview *)[cell viewwithtag:100]; itemimageview.layer.borderwidth = 1.0f; itemimageview.layer.bordercolor = [uicolor concretecolor].cgcolor; itemimageview.layer.maskstobounds = no; itemimageview.clipstobounds = yes;
so have 50x50 square faint grey border, i'd make circular instead of squared. app hemoglobe
uses circular images in table views, , that's effect i'd achieve. however, don't want use cornerradius
, degrades scrolling fps.
here's hemoglobe
showing circular uiimageviews
:
is there way effect? thanks.
simply set cornerradius
half of width or height (assuming object's view square).
for example, if object's view's width , height both 50:
itemimageview.layer.cornerradius = 25;
update - user atulkhatri points out, won't work if don't add:
itemimageview.layer.maskstobounds = yes;
Comments
Post a Comment