方法一:改在Controller里面
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (self.tableView.editing)
{
for (UIView * view in cell.subviews)
{
if ([NSStringFromClass([view class]) rangeOfString: @"UITableViewCellReorderControl"].location != NSNotFound)
{
for (UIView * subview in view.subviews) {
if ([subview isKindOfClass: [UIImageView class]])
{
((UIImageView *)subview).image = [UIImage imageNamed: @"accessory_next"];
}
}
}
}
}
}
方法二:改在UITableViewCell里面
- (void) setEditing:(BOOL)editing animated:(BOOL)animated
{
[super setEditing: editing animated: YES];
if (editing) {
for (UIView * view in self.subviews) {
if ([NSStringFromClass([view class]) rangeOfString: @"Reorder"].location != NSNotFound) {
for (UIView * subview in view.subviews) {
if ([subview isKindOfClass: [UIImageView class]]) {
((UIImageView *)subview).image = [UIImage imageNamed: @"yourimage.png"];
}
}
}
}
}
}
网友评论