在定制的cell类里面写如下代码
- (void)layoutSubviews {
[super layoutSubviews];
for (UIView *subView in self.subviews){
if([subView isKindOfClass:NSClassFromString(@"UITableViewCellDeleteConfirmationView")]) {
UIView *confirmView=(UIView *)[subView.subviews firstObject];
// 改背景颜色
confirmView.backgroundColor = GLCOLORBOTTOM;
if([confirmView isKindOfClass:NSClassFromString(@"UIButton")]){
UIButton *deletebtn=(UIButton *)confirmView;
// 改删除按钮
[deletebtn setImage:[UIImage imageNamed:@"icon_delete_round"] forState:UIControlStateNormal];
[deletebtn setTitle:nil forState:UIControlStateNormal];
}
break;
}
}
}
样式如下
IMG_1576.PNG
网友评论