#pragma mark 直接创建view,然后对view边角进行处理
UIView *view2 = [[UIView alloc] initWithFrame:CGRectMake(10, 400, 80, 80)];
view2.backgroundColor = [UIColor redColor];
[self.view addSubview:view2];
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:view2.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(8, 8)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = view2.bounds;
maskLayer.path = maskPath.CGPath;
view2.layer.mask = maskLayer;
#pragma mark imageView圆边设置
UIImageView *whiteBackImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 20, 200, 200)];
whiteBackImageView.image = [UIImage imageNamed:@"cell背景白图"];
[self.view addSubview:whiteBackImageView];
UIBezierPath *whiteBackImageViewPath = [UIBezierPath bezierPathWithRoundedRect:whiteBackImageView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(8, 8)];
CAShapeLayer *whiteBackImageViewLayer = [[CAShapeLayer alloc] init];
whiteBackImageViewLayer.frame = whiteBackImageView.bounds;
whiteBackImageViewLayer.path = whiteBackImageViewPath.CGPath;
whiteBackImageView.layer.mask = whiteBackImageViewLayer;