I'm trying to make a semi-transparent border around a UIView. The idea is to show a picture but have the border cover the edge of the picture yet still allow you to see what is behind the border. I want the border to have different border-widths for the different sides. On the top i would like to have a border of 80 pts, on the bottom I want a border of 60 pts, and on the sides I want a border of 10 pts. I know that using the code :
UIView.layer.borderColor = [UIColor blueColor].CGcolor;
UIView.layer.borderWidth = 10;
will give you a uniform border of width 10 all around the inside of the UIView, but how do I set different border widths for different sides of the UIView?
To my knowledge, its not possible to get what you want just by using the properties of a UIView or its backing layer. You may have to use another UIView(s) which contain the specific border you want (maybe as a custom graphic) and overlay it on top of your image.
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