本文介绍了GestureOverlayView阻止触摸事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要创造我的手势自定义视图,我想自己一个吸引他们。
I wish to create a custom view for my gestures, I wish to draw them by my self.
但我没有得到触摸事件,还是我让他们和GestureOverlayView没有。
But I do not getting touch events, or I am getting them and the GestureOverlayView not.
你能帮助我,请让我们都让所有的触摸事件?
Can you help me please making us both getting all the touch events?
推荐答案
我想你可能会做一个愚蠢的错误我是做pviously $ P $。不采取平行gestureOverlayView您要touchables意见,但把这些意见gestureOverLayView的孩子。
I think you might be doing a silly mistake i was doing previously. dont take gestureOverlayView parallely to views you want touchables, but take those views as child of gestureOverLayView.
你不应该做的。
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<android.gesture.GestureOverlayView
android:id="@+id/gOverlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:eventsInterceptionEnabled="true"
android:fadeOffset="1000"
android:gestureColor="@color/gesture_color"
android:gestureStrokeType="multiple"
android:uncertainGestureColor="@color/gesture_color" >
</android.gesture.GestureOverlayView>
<LinearLayout
android:id="@+id/customtab"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="3" >
</LinearLayout>
</RelativeLayout>
你应该做的。
<android.gesture.GestureOverlayView
android:id="@+id/gOverlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:eventsInterceptionEnabled="true"
android:fadeOffset="1000"
android:gestureColor="@color/gesture_color"
android:gestureStrokeType="multiple"
android:uncertainGestureColor="@color/gesture_color" >
<LinearLayout
android:id="@+id/customtab"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3" >
</LinearLayout>
</android.gesture.GestureOverlayView>
这篇关于GestureOverlayView阻止触摸事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!