-(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
网友评论