views:

120

answers:

2

Is there any way to change the image of the reorder control that is displayed when the UITableView is in edit mode? I have a UIImage that I’d like to display instead of the usual grey bars.

Do I have to subclass UITableViewCell to accomplish this?

A: 

You set the cell's editingAccessoryView property to an image view containing the image you want.

As an aside, I would caution you to be careful when doing this. When you substitute a custom graphic for a system standard such as the reorder graphic, you run a serious risk of confusing the user. The standard UI grammar has told them to expect the standard graphic when reordering and they may not understand the significance of your custom graphic.

TechZen
It’s not that different from the default view; the lines are wavy instead of straight…
Raphael Schweikert
Where do I need to do this? If I do it when instanciating the cell, the only thing I get is an additional view left of the default reorder view. I also can’t reorder the cells when dragging the new image. I’ve tried setting `cell.editingAccessoryType = UITableViewCellEditingStyleNone;` but to no avail.
Raphael Schweikert
The docs say to use `UITableViewCellAccessoryDetailDisclosureButton` or the editing accessory view never appears or responds. Read the UITableView docs for detail.
TechZen
A: 

I put a little work into this recently, but came up short. I tried setting my own editingAccesoryView but couldn't get the reorder control to change. Odd.

My guess is that it has something to do with the following comment in the UITableviewCell docs re: showsReorderControl:

If the value is YES , the reordering control temporarily replaces any accessory view.

In other words, the the editingAccessoryView is being replaced by the reordering control view, which might be why we cannot override the reordering control. Hoping someone can find a workaround.

Andrew Little