在我的应用程序中,我当前正在绘制一个基本视图,然后我尝试使用CAShapeLayer对其边角进行圆角处理,但UICollisionBehavior的反应仍然像是绘制了一个正方形。
下面是我的代码示例
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.bounds
byRoundingCorners:UIRectCornerAllCorners
cornerRadii:radiiSize];
// Mask the container view’s layer to round the corners.
CAShapeLayer *cornerMaskLayer = [CAShapeLayer layer];
[cornerMaskLayer setPath:path.CGPath];
self.containerView.layer.mask = cornerMaskLayer;
self.containerView.layer.allowsEdgeAntialiasing = YES;发布于 2014-01-21 10:58:53
就这样做,而不是使用UIBezierPath
self.containerView.layer.cornerRadius = [Radius is half the height/width];
self.containerView.clipsToBounds = YES;https://stackoverflow.com/questions/21248244
复制相似问题