0
在相对布局中有一个viewpager和RelativeLayout。ViewPager在其上有视图时无法响应触摸事件
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:weather="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/mainview_id">
<android.support.v4.view.ViewPager
android:id="@+id/main_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<PushPullDoorView
android:id="@+id/pull_down_view"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</PushPullDoorView>
的PushPullDoorView已经覆盖的onTouchEvent method.it可以被拖累而up.But当我尝试移动viewpager,它不会响应event.I尝试覆盖dispatchTouchEvent ,onInterceptTouchEvent,并设置返回值为true或false.It仍然不起作用。
PushPullDoorView具有透明背景。我们可以看到视图内容。所以我想在被覆盖的时候移动vewpager。任何想法? – shaotine
我发现了我在onTouchEvent方法中返回true的原因。删除它,它完美地工作。 – shaotine