Vote count:
0
I have a rectangular UIView object in a static table view cell. I have an outlet to the object and I'm trying to selectively round corners with this code:
CAShapeLayer *shape = [[CAShapeLayer alloc] init];
shape.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, self.myView.bounds.size.width, self.myView.bounds.size.height)
byRoundingCorners:UIRectCornerBottomRight
cornerRadii:CGSizeMake(5.0f, 5.0f)].CGPath;
self.mView.layer.mask = shape;
self.myView.layer.masksToBounds = YES;
But it doesn't work for either of the right-hand corners. It works fine for either of the left-hand corners.
Oddly, I can round all four corners with this:
self.myView.layer.cornerRadius = 5.0f;
self.myView.clipsToBounds = YES;
I have tested the bezier code with a different view object on an ordinary view controller (outside of a table view) and the code works as expected--I can round any corner selectively.
Any ideas why it's not working in a cell?
asked 42 secs ago
UIView in cell -- Can't round right-hand corners
Aucun commentaire:
Enregistrer un commentaire