系统效果:
1.只改变蓝色底色,可以// cell.tintColor = [UIColor redColor];
2.改变图片和位置,
- (void)setEditing:(BOOL)editing animated:(BOOL)animated{
[super setEditing:editing animated:animated];
for (UIControl *control in self.subviews){
if ([control isMemberOfClass:NSClassFromString(@"UITableViewCellEditControl")]){
for (UIView *v in control.subviews){
if ([v isKindOfClass: [UIImageView class]]) {
UIImageView *img=(UIImageView *)v;
// img.frame = CGRectMake(img.frame.origin.x, CountHeight(20), img.frame.size.width, img.frame.size.height);
img.center = CGPointMake(img.center.x, img.frame.size.height+5);
if (!self.selected) {
img.image=[UIImage imageNamed:@"weixuanzhongimg.png"];
}
}
}
}
}
}
-(void)layoutSubviews{
NSLog(@"%@",self.subviews);
for (UIControl *control in self.subviews){
if ([control isMemberOfClass:NSClassFromString(@"UITableViewCellEditControl")]){
for (UIView *v in control.subviews){
if ([v isKindOfClass: [UIImageView class]]) {
UIImageView *img=(UIImageView *)v;
img.center = CGPointMake(img.center.x, img.frame.size.height+5);
// img.frame = CGRectMake(img.frame.origin.x, CountHeight(20), img.frame.size.width, img.frame.size.height);
if (self.selected) {
img.image=[UIImage imageNamed:@"xuanzhongimg.png"];
}else{
img.image=[UIImage imageNamed:@"weixuzhongimg.png"];
}
}
}
}
}
[super layoutSubviews];
}
效果