You may have seen several mobile applications with round or circular image view. It is mostly used while displaying User's profile pic or in a tabular representation of images. You can do it very easily without using third party classes or Libraries.
But before applying below code please keep in mind that your UIImageView width and Height should be equal.
UIImageView *yourImgView = [[UIImageView alloc]initWithFrame:CGRectMake(5, 2, 50, 50)];
yourImgView.layer.cornerRadius = yourImgView.frame.size.width/2;
[yourImgView.layer setBorderWidth:1.0];
[yourImgView setClipsToBounds:YES];
This will round your imageview. But if you are using Autolayout then it will give you an oval shape not circular.
0 Comment(s)