当上面有视图时,ViewPager 无法响应触摸事件

ViewPager can not response the touch event when there is a view on top of it

相对布局中有一个viewpager和一个RelativeLayout。

<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,并且设置return值为true或者false.It还是不行。

PushPullDoorView 和 android.support.v4.view.ViewPager 都具有 android:layout_height="match_parent",因此只有一个视图会在屏幕上接触。尝试更改布局设计来解决此问题。