I have an UIImageView
. I want to make it as a circle type and 5 pixel red color border around it.
How it is possible? I share code and image also. Please anybody help me ?
My code is:
UIImageView *myImageview = [[UIImageView alloc] initWithFrame:CGRectMake(130, 200, 60, 60)];
[myImageview setImage:[UIImage imageNamed:@"image.png"]];
[self.view addSubview:myImageview];
Simply you can make it.
Just follow this code..
#import <QuartzCore/QuartzCore.h>
[myImageview.layer setBorderColor:[[UIColor redColor] CGColor]]; // For border color
[myImageview.layer setBorderWidth:5.0]; // For Border width
[myImageview.layer setCornerRadius:45.0f]; // For Corner radious
[myImageview.layer setMasksToBounds:YES];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With