Use Rounded Image VIew in IOS App

We can use Rounded Image in IOS Application.

Step 1 : Create an Image View either using the Interface builder or by code
Note that the width and height should be same.

Now we are creating it by code

UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 100, 100)];
imgView.image = [UIImage imageNamed:@"test_image.png"];

here in CGRectMake(10, 10, 100, 100) first two parameters defines x and y co-ordinate to position the image, then the 3rd and 4th parameter is the width and height.

Step 2 : Now apply radius for the image view

imgView.layer.cornerRadius = 50;
[imgView.layer setMasksToBounds:YES];

Put the raduis value to half of the width/height.

Step 3 : Clean your xcode project and Run… You can see now the rounded image… Done…

Leave a Comment

DON’T MISS OUR GIVEAWAYS!
Subscribe To Newsletter
Subscribe to our newsletter and get all the latest updates offers and giveaways right in your inbox.
Subscribe
Give it a try, you can unsubscribe anytime.
close-link

Join Free Giveaway!

Subscribe to our newsletter to get latest offers and giveaways!
SUBSCRIBE
close-link