本文介绍了Android的磨损覆盖通行证上触摸事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有一个Android Wear应用程序中,我使用一个透明的覆盖,以免费获赠触摸事件。我需要能够接受这种情况发生在屏幕上的任何位置的所有触摸事件,也能看到它们的坐标。I have an Android Wear app in which I use a transparent overlay view to recieve touch events. I need to be able to receive all touch events that happen anywhere on the screen, and also be able to see their coordinates.所有的研究,我发现说,我不能接受她所有的触摸事件,并通过他们的。然而,穿迷你发射器和 Swipify 都做这样的事情这一点。All research I have found says that I cannot recieve all touch events and pass them on. However, Wear Mini Launcher and Swipify are both doing something like this.下面是我看过: Android覆盖抓住所有的触摸,并通过他们? http://stackoverflow.com/questions/19356834/overlay-view-which-intercepts-some-events Android - 拦截和传球上的所有触摸事件 Android :多点触摸和TYPE_SYSTEM_OVERLAY Creating系统覆盖窗口(总在最前) Getting正在接收所有的触摸事件的视图 Android接收所有触摸事件 果冻豆服务 TYPE_SYSTEM_OVERLAY在ICS Overlay应用程序只有反作用于某些触摸事件Android overlay to grab ALL touch, and pass them on?http://stackoverflow.com/questions/19356834/overlay-view-which-intercepts-some-eventsAndroid - Intercept and pass on all touch eventsAndroid : Multi touch and TYPE_SYSTEM_OVERLAYCreating a system overlay window (always on top)Getting the View that is receiving all the touch eventsAndroid Jelly Bean service that receives all touch eventsTYPE_SYSTEM_OVERLAY in ICSOverlay App that reacts only on some touch events这一定是可以做到的某种方式。也许叠加的观点是不正确的方式来处理这个?任何指针?This must be possible to do somehow. Maybe an overlay view is not the right way to approach this? Any pointers?推荐答案我有相当多的麻烦,这一点使用您所提供的相同的链接,以及。但后来我发现这一点: http://www.piwai.info/chatheads-basics/I had quite a bit of trouble with this as well using the same links that you provided. But then I found this: http://www.piwai.info/chatheads-basics/这是基本相同的其他解决方案,除了参数的窗口管理器 的LayoutParams 是 TYPE_PHONE 和 FLAG_NOT_FOCUSABLE 。It's basically the same as the other solutions, except that the arguments to the WindowManager LayoutParams are TYPE_PHONE and FLAG_NOT_FOCUSABLE.不仅为我做的这个解决方案的工作(我在测试上LG文雅),在的onTouchEvent 回调了所有的动作(下降,移动及以上),其中,其他的解决方案说你不会得到的。Not only did this solution work for me (I was testing on an LG Urbane), the onTouchEvent callback had all the actions (down, move, and up), which the other solutions said you wouldn't get.由于所有的触摸事件是通过看得见的地方经过,理论上我们可以用手势探测器获得的回调,像双水龙头和飞灰湮灭。我没有试过呢,虽然。Since all the touch events are passed through the view, in theory we can use gesture detectors to get callbacks for things like double taps and flings. I haven't tried this yet, though.无论如何,上面的链接应该让你过去,你所面临的最初的问题。Regardless, the above link should get you past the initial problems you're facing. 这篇关于Android的磨损覆盖通行证上触摸事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-20 08:14
查看更多