UITableView:将单元格移动到另一个位置,并拖动&下降 [英] UITableView: move cell to a position to another with drag & drop
问题描述
示例1:
在第一部分中,我有两行(sec1_row1和sec1_row2)。在第二部分中,我有一行(sec2_row1)通过拖放drop功能我想用sec2_row1反转sec1_row2。我想选择sec2_row1,将其拖放到sec2_row1上,并将其拖放到相反的行。
我希望此功能也可用于同一部分的行。
实现此功能的最佳方式是什么?
提前感谢
/ p>
你需要管理
targetIndexPathForMoveFromRowAtIndexPath
canMoveRowAtIndexPath
i have a table with 3 section (section one, section two and section three). I would like implement a mechanism to change a cell's position with drag & drop (inside same section or from a section to another).
Example 1: In section one i have two rows (sec1_row1 and sec1_row2). In section two i have one row (sec2_row1) by drag & drop function i would like invert the sec1_row2 with sec2_row1. I would like select the sec2_row1, drag it on sec2_row1 and drop it so the rows are inverted.
I would like that this feature will be also available for rows of same section.
What is the best way to implement this feature?
Thanks in advance.
Check this apple doc link
you need to manage conditions in
targetIndexPathForMoveFromRowAtIndexPath
canMoveRowAtIndexPath
这篇关于UITableView:将单元格移动到另一个位置,并拖动&下降的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!