I try to add border around non-square png image with layer.borderColor
and CGContextSetStrokeColorWithColor
but this result in square border around image not around the real image.
Is there a way to do this ?
I try to add border around non-square png image with layer.borderColor
and CGContextSetStrokeColorWithColor
but this result in square border around image not around the real image.
Is there a way to do this ?
If you want a rounded ImageView.
UIImageView *imageView = [[UIImageView alloc] initWithImage: [UIImage imageNamed:@""]];
imageView.layer.borderColor = [UIColor blackColor].CGColor; // Apply Color of your choice
imageView.layer.borderWidth = 2.0; // Apply width of your choice
imageView.layer.cornerRadius = 50; // Apply radius of your choice
imageView.clipsToBounds = YES;