This question already has an answer here:
- UIImage rounded corners 15 answers
I am confused on how I would round corners, I've seen about 10 other posts and non of them have helped me. Am I doing this correctly?
#import "QuartzCore/QuartzCore.h" // in my ViewController.h
- (void)viewDidLoad
{
[super viewDidLoad];
self.backgroundLayer.cornerRadius = 10.0f;
}
If somebody could help me out on this it'd be greatly appreciated.
Yes, You are correct but set
self.backgroundLayer.layer.borderWidth
, I put following code might be helpful in your case.For give round Border Of
UIView
.Add
#import "QuartzCore/QuartzCore.h"
fram work. (you've already done it)in your case give border of
UIView
.Try turning on
masksToBounds
. Also, what is backgroundLayer?