Reputation: 21
I'm placing the blurview in a UITableViewCell. So the cell's background color is set to clear color. But I want specific corners to be rounded as well.
I came across this solution for getting rounded corners.
But this works only when the view has a background color. I just want the specific corners rounded with clear color.
Thanks in advance.
Upvotes: 0
Views: 301
Reputation: 1247
Try this
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.viewOutlet.bounds byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerBottomLeft | UIRectCornerBottomRight) cornerRadii:CGSizeMake(10.0, 10.0)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = self.view.bounds;
maskLayer.path = maskPath.CGPath;
self.viewOutlet.layer.mask = maskLayer;
Upvotes: 1