拖放drop:检测你正在掉落的东西
Cocoa-Touch 的长辈们,我有一个关于 Drag & 的问题要问你们。放在 iPad 上。
我正在尝试将一个项目从弹出窗口拖到底层画布上。使用 UIPanGestureRecognizer 类,我可以检测拖动开始并创建一个 UIView 以用指尖拖动。我的应用程序以横向模式运行。
当在下面的 UIViews 树上拖动时,麻烦就来了:我怎样才能找到我当前正在拖动的内容?当给定 [UIApplication sharedApplication].keyWindow 时,[UIView hitTest:withEvent:] 始终 返回一个 UIDimmingView (我没有放在那里)。如果我将创建的 UIView 传递给 hitTest 调用,那么我无法检测到返回到原始弹出窗口的情况 - 因此无法检测到“毕竟不要拖动”手势。
非常欢迎您的线索和嘘声。
M。
Assembled elders of the Cocoa-Touch, I have a question for you all about Drag & Drop on the iPad.
I am attempting to drag an item from a popover onto an underlying canvas. Employing the UIPanGestureRecognizer class I can detect a drag-start and create a UIView to drag with the finger tip. My application runs in landscape mode.
The trouble comes when dragging across the tree of UIViews underneath: how can I find out what I am dragging across currently? When given [UIApplication sharedApplication].keyWindow, [UIView hitTest:withEvent:] always returns a UIDimmingView (that I didn't put there). If I pass a UIView that I've created to the hitTest call then I cannot detect a drop back onto the original popover - and therefore cannot detect a "don't drag after all" gesture.
Your clues and boos are most welcome.
M.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论