把以下代码放在点解 “编辑” 按钮时触发的方法中。
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 0.001);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
for (UIView *sv in self.self.tableView.subviews) {
if ([sv isKindOfClass:[UITableViewCell class]]) {
UITableViewCell *cell = (UITableViewCell *)sv;
for (UIView *ssv in cell.subviews) {
// 判断该subview是否为 删除按钮, 删除按钮坐标为:x:10.0
if (ssv.frame.origin.x == 10.0) {
// 此处修改删除按钮样式,样例代码如下
IVTableViewCellEditControl *editControl = [[IVTableViewCellEditControl alloc] initWithImage:PNGImage(PASS_CELL_DELETE_ICON)];
editControl.frame = CGRectMake(10, 0, editControl.frame.size.width, editControl.frame.size.height);
[cell addSubview:editControl];
[editControl release];
ssv.hidden = YES;
[ssv setRotated:YES animated:YES];
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 18.5, 21)];
imgView.image = PNGImage(PASS_CELL_DELETE_ICON);
[imgView release];
}
}
}
}
});