Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Round or Circular ImageView in iOS

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 530
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: