答案 0 :(得分:1)
你可以做点什么,
UIBezierPath *maskPath;
maskPath = [UIBezierPath bezierPathWithRoundedRect:YourImageView.bounds
byRoundingCorners:(UIRectCornerBottomLeft|UIRectCornerTopLeft|UIRectCornerTopRight)
cornerRadii:CGSizeMake(4.0, 4.0)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = YourImageView.bounds;
maskLayer.path = maskPath.CGPath;
YourImageView.layer.mask = maskLayer;
编辑:
YourImageView.clipsToBounds=YES;
YourImageView.layer.borderWidth = 1;
YourImageView.layer.borderColor = [[UIColor blueColor] CGColor];
确保您导入QuartzCore
框架:
#import <QuartzCore/QuartzCore.h>