四种设置圆角的方法
从网上收集了各种设置圆角的方法,总结起来有以下四种:
1、设置 layer 的 cornerRadius
view.layer.masksToBounds = YES;
view.layer.cornerRadius = imgSize.width / 2;
2、用贝塞尔曲线作 mask 圆角
CAShapeLayer *layer = [CAShapeLayer layer];
UIBezierPath *aPath = [UIBezierPath bezierPathWithOvalInRect:view.bounds];
layer.path = aPath.C