UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:portrait.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(20, 20)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = portrait.bounds;
maskLayer.path = maskPath.CGPath;
portrait.layer.mask = maskLayer;
[maskLayer release];
本文介绍如何使用UIBezierPath和CAShapeLayer为UIImageView创建特定的圆角效果。通过设置不同角落的圆角半径,可以实现底部左上角和顶部右上角圆角的效果。
3217

被折叠的 条评论
为什么被折叠?



