众所周知,当tableView进入editMode时,ios默认提供一些功能,例如左侧的delete按钮和另一个按钮来重新排列每个单元格右侧的行。
我所要做的只是实现行的重新排列,在每个单元格上都有一个按钮,,但不进入编辑模式.。
到目前为止,我已经试过了,不知道该怎么做,
此函数在单击按钮时被调用并拖动。
- (void)dragCell:(CustomCell *)cell
{
NSIndexPath *fromIndexPath = [m_tableView indexPathForCell:cell];
NSArray *array1 = [Array2 objectAtIndex:[fromIndexPath row]];
[Array2] removeObjectAtIndex:[fromIndexPath row]];
[Array2] insertObject:page atIndex:[toDestIndexPath row]];**//dont know how to get this toDestIndexPath**
[m_tableView moveRowAtIndexPath:fromIndexPath toIndexPath:toDestIndexPath];
}请帮帮我。
问候兰吉特
发布于 2012-12-20 08:42:00
使用这个。它实现了您想要做的事情:https://github.com/FlorianMielke/FMMoveTableView
不需要编辑模式。:)
https://stackoverflow.com/questions/12853213
复制相似问题