UITableView: moving a row into an empty section
Posted
by Frank C
on Stack Overflow
See other posts from Stack Overflow
or by Frank C
Published on 2009-03-17T16:07:56Z
Indexed on
2010/03/23
6:53 UTC
Read the original article
Hit count: 436
I have a UITableView with some empty sections. I'd like the user to be able to move a row into them using the standard edit mode controls. The only way I can do it so far is to have a dummy row in my "empty" sections and try to hide it by using
tableView:heightForRowAtIndexPath:
to give the dummy row a height of zero. This seems to leave it as a 1-pixel row. I can probably hide this by making a special type of cell that's just filled with [UIColor groupTableViewBackgroundColor], but is there a better way?
This is all in the grouped mode of UITableView
UPDATE: Looks like moving rows into empty sections IS possible without any tricks, but the "sensitivity" is bad enough that you DO need tricks in order to make it usable for general users (who won't be patient enough to slowly hover the row around the empty section until things click)
© Stack Overflow or respective owner