美文网首页
iOS cell 左滑返回 定制返回按钮

iOS cell 左滑返回 定制返回按钮

作者: 孤胆走天涯 | 来源:发表于2017-08-08 18:25 被阅读27次

在定制的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

相关文章

网友评论

      本文标题:iOS cell 左滑返回 定制返回按钮

      本文链接:https://www.haomeiwen.com/subject/echxrxtx.html