I have a UITableView
that implements the reorder controls. It all works great with the exception of one thing. When I drag the cell, all UIView
subviews are hidden. Is there a way to prevent that from happening? I tried to add a UIImage
for the background (semi-transparent) to appear when you enter edit mode, but that caused another issue where the image was resized to the left side of the handles.
Asked
Active
Viewed 1,503 times
12

Kate Gregory
- 18,808
- 8
- 56
- 85

Buyin Brian
- 2,781
- 2
- 28
- 48
-
1How did you add the hiding subviews to the cell? As subviews of the cell's `view` or the cell's `contentView`? For a custom background while editing, you should subclass `UITableViewCell` and override `-setEditing:`. – Mark Adams Dec 10 '11 at 00:28
-
The hiding of the subviews happens automagically. I am using a subclassed UITableviewcell, I tried setEditing, but I have no idea what to do in there to prevent this. If there was a delegate method for when you are dragging a cell in editing mode, that would be helpful – Buyin Brian Dec 10 '11 at 04:14
-
I have this same issue — UITableViewCell appears to hide or somehow make transparent the `contentView` when the cell is being dragged in a re-order operation. I have found it necessary to add an extra dummy subview to `contentView`, and then add all actual content views to that. – simeon Nov 15 '12 at 23:45
-
9I think you should add some images to better reflect the problem you're having, and eventually any sample code that you feel may be relevant. – diegoreymendez Nov 28 '12 at 19:15
-
rather than add to the contentView have you tried adding your background to the cell's backgroundView ? – Andrew Tetlaw Dec 27 '12 at 08:27
2 Answers
1
You could set the backgroundView
of UITableViewCell
and add the subviews to the backgroundView
: http://developer.apple.com/library/ios/documentation/uikit/reference/UITableViewCell_Class/Reference/Reference.html#//apple_ref/occ/instp/UITableViewCell/backgroundView

user1104404
- 56
- 6
0
Hi you can create your custom tableview with your own requirements. You can also use collection view as table view and enable rearrange. If you dont want to do like this you can use this great readymade RTGridView.
https://github.com/rickytan/RTGridView
Let i know if you need any more help on this.