美文网首页程序员iOS学习专题
iOS 修改tableview编辑模式下选中图片

iOS 修改tableview编辑模式下选中图片

作者: 旅途开发者 | 来源:发表于2018-07-06 14:59 被阅读8次
for (UIControl * control in self.subviews){
            if ([control isMemberOfClass:NSClassFromString(@"UITableViewCellEditControl")]){
                for (UIView * view in control.subviews){
                    if ([v isKindOfClass: [UIImageView class]]) {
                        UIImageView * imgView=(UIImageView *)view;
                       //这里是把图片修改为圆形
                        [imgView.layer setMasksToBounds:YES];
                        [imgView.layer setCornerRadius:(img.frame.size.height / 2)];
                        if (self.selected) {
                            //选中图片
                            imgView.image=[UIImage imageNamed:@"cellSelect"];
                        }else{
                           //未选中图片
                            imgView.image=[UIImage imageNamed:@"cellUnSelect"];
                        }
                    }
                }
            }
        }

相关文章

网友评论

    本文标题:iOS 修改tableview编辑模式下选中图片

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