view的下半两个切角

2019-05-08  本文已影响0人  lifeLL
-(void)setModel:(DeviceInfoAppList *)model{
    _model = model;
    if (model.isend) {
        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.viewBG.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)];
        CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
        maskLayer.frame = self.viewBG.bounds;
        maskLayer.path = maskPath.CGPath;
        self.viewBG.layer.mask = maskLayer;
    }
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) { // 初始化子控件
        self.viewBG = [[UIView alloc] init];
        self.viewBG.frame= CGRectMake(30, 0, SCREEN_W-60, 63);
        [self.contentView addSubview:self.viewBG];
    }
    return self;
}
 UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:label.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10, 10)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = label.bounds;
    maskLayer.path = maskPath.CGPath;
    label.layer.mask = maskLayer;
11557296371_.pic.jpg
上一篇 下一篇

猜你喜欢

热点阅读