[英]How to detect if a view is being touched if the press down originates outside of that view?
I want to touch down on the view of object B and swipe to ie.我想触及 object B 的视图并滑动到 ie。 object 3 where I release it. object 3 我发布的地方。 It needs to register that is has been released at object 3. I thought to give object 3 a OnTouchListener as well but that ontouchlistener is not called since it started outside of its view.它需要注册已在 object 3 发布的。我想给 object 3 一个 OnTouchListener,但没有调用 ontouchlistener,因为它在其视图之外启动。 I dont think a global ontouchlistener working back to coordinates will work since its all in a ScrollView.我认为返回坐标的全局 ontouchlistener 不会起作用,因为它全部在 ScrollView 中。 I tried several callback but none seem to work and I can't find an answer to this.我尝试了几个回调,但似乎都没有用,我找不到答案。 So, How to detect if a view is being touched if the press down originates outside of that view?那么,如果按下来自该视图之外,如何检测是否正在触摸该视图?
As @cactustictacs suggested the Drag and Drop works great for this.正如@cactustictacs 所建议的那样,拖放非常适合此操作。 Basically:基本上:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.