Home Image View Double Border
Reply: 0

Image View Double Border

user876
1#
user876 Published in July 16, 2018, 6:46 am

I'm calling a function that sets up a UIImageView:

func setupImageView(_ imageView: UIImageView) {}

I want to give that UIImageView an image, round its corners, and give it two different borders.

Here is what I am currently doing:

imageView.image = imageConstants.imageThatIsWanted
imageView.clipsToBounds = true
imageView.layer.cornerRadius = imageView.frame.height / 2
imageView.layer.borderWidth = 3.0
imageView.layer.borderColor = UIColor.white.cgColor

What is the best way to apply a second borderColor of color blue around the white border?

I tried creating a sublayer as a CALayer and giving it a blue border, but this goes behind the image, and also inside of the white border. I also tried drawing a UIBezierPath, but that stays inside of the white border as well.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.325085 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO