1

I am using the following code to achieve the top right and left corner for my main UIView:

UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.view.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10.0, 10.0)];

CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = self.view.bounds;
maskLayer.path = maskPath.CGPath;
[maskLayer setMasksToBounds:YES];
self.view.layer.mask = maskLayer;

But after that, all subviews like UIButtons contained in the UIView stop working. I think this could be a no brainer, but I just couldn't get the solution after much of the googling work.

Thanks in advance.

Cheers.

joe kirk
  • 700
  • 2
  • 10
  • 25
  • Here try this. I believe this person had a similar goal. http://stackoverflow.com/questions/7071815/ios-mask-a-uiimage-using-uibezierpath or http://stackoverflow.com/questions/4847163/round-two-corners-in-uiview/4936555#4936555 – Chance R. Jun 25 '12 at 20:22

0 Answers0