【发布时间】:2011-11-13 18:54:20
【问题描述】:
我在 UIScrollView 中有一个 UIView。当我想模拟 UIView 上的拖动事件时,正在触发 UIScrollView 上的滑动事件。
根据 documentation ,滑动和拖动之间没有太大区别。
滑动
1- Place the pointer at the start position.
2- Hold the mouse button.
3- Move the pointer in the swipe direction and release the mouse button.
拖动
1- Place the pointer at the start position.
2- Hold down the mouse button.
3- Move the pointer in the drag direction.
在 ipad 上,我可以用两根手指两次滑动和一根手指拖动。现在,我该如何在模拟器上做类似的事情;拖动而不是滑动?
编辑 1: 我应该先更清楚。无论如何,我的问题是鼠标拖动是触发滑动而不是拖动,从而滚动滚动视图而不是将拖动事件传递给滚动视图包含的 UIView。 我在macbook pro上。触摸板上的两指轻扫被忽略。触摸和拖动导致与鼠标拖动相同的事情。 谢谢
【问题讨论】:
-
可以通过使用macbook触摸板/魔术触控板吗?
-
@Marek 触摸板没有多大帮助。两指滑动被忽略,没有任何反应。按住并拖动会产生与鼠标拖动相同的效果。我已经更新了问题。
-
嗯,手势和滚动视图有点问题,因为它首先接收事件......如果你真的想这样做,我认为你应该覆盖 hitTest:withEvent: 并检查哪个视图有事件并传递给它
标签: objective-c ios drag swipe ios-simulator