使用长按手势来重新排列表格视图中的单元格? [英] Using long press gesture to reorder cells in tableview?
问题描述
我希望能够使用longPress手势(而不是标准的重新排序控件)对表格单元格进行重新排序.识别longPress后,我希望tableView实质上进入编辑模式",然后重新排序,就像使用Apple提供的重新排序控件一样.
I want to be able to reorder tableview cells using a longPress gesture (not with the standard reorder controls). After the longPress is recognized I want the tableView to essentially enter 'edit mode' and then reorder as if I was using the reorder controls supplied by Apple.
有没有一种方法可以不需要依赖第三方解决方案?
Is there a way to do this without needing to rely on 3rd party solutions?
谢谢.
我最终使用了公认的答案中的解决方案,并依赖于第三方解决方案.
I ended up using the solution that was in the accepted answer and relied on a 3rd party solution.
推荐答案
因此,基本上,您需要,对吗? (大约0:15)
So essentially you want the "Clear"-like row reordering right? (around 0:15)
不幸的是,我认为您不能使用当前的iOS SDK工具来做到这一点,而不能从头开始将UITableView + Controller一起砍死(您需要自己创建每一行,并让UITouch响应与您的CGRect相关的问题行到移动).
Unfortunately I don't think you can do it with the present iOS SDK tools short of hacking together a UITableView + Controller from scratch (you'd need to create each row itself and have a UITouch respond relevant to the CGRect of your row-to-move).
这将非常复杂,因为在移动要重新排序的行时,您需要使行的动画摆脱干扰".
It'd be pretty complicated since you need to get the animation of the rows "getting out of the way" as you move the row-to-be-reordered around.
可可工具看上去很有前途,至少要看看源头.
The cocoas tool looks promising though, at least go take a look at the source.
这篇关于使用长按手势来重新排列表格视图中的单元格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!