【发布时间】:2015-05-06 22:23:46
【问题描述】:
我有 UITableView,并添加了移动单元格的功能。
http://s017.radikal.ru/i402/1503/76/3442a9517cec.png
所以,如果 longPressGesture 被识别,我将单元格隐藏,拍摄单元格的快照(在图片上以灰色突出显示),并在 longPressGestureStateChanged 时更改它的位置。但是移动的动画看起来很糟糕。
如果我在 longPressGestureBegan 时添加 panGesture,直到我再次触摸和触摸后它才会起作用,然后 panGestureStateChanged 开始工作,并且移动变得平滑。
我需要 panGesture 在 longPressGestureBegan 时开始工作,或者捕捉屏幕触摸位置。
但难点在于:(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;等等...在 UITableView 上不起作用。
我读了很多书,但没有任何根据。这是定制案例。例如,我需要仅在识别出 longPressGesture 时才识别 pinchGesture,而无需进行修饰。
有人知道怎么解决吗?
【问题讨论】:
标签: ios objective-c uitableview touch gesture