在我的Android應用程序,我以下佈局:調度事件墊層Viewpager
<CustomRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v4.view.ViewPager
android:id="@+id/image_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<OverScrollBounceScrollView
android:id="@+id/scrollview"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
>
<LinearLayout
android:id="@+id/user_profile_scroll_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<RelativeLayout
android:id="@+id/dummy_viewport"
android:layout_width="match_parent"
android:layout_height="350dp"
>
</RelativeLayout>
<LinearLayout
android:id="@+id/scroll_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/white"
>
...some content
</LinearLayout>
</LinearLayout>
</OverScrollBounceScrollView>
</CustomRelativeLayout>
它看起來這個問題:
http://i.stack.imgur.com/lzL5u.png
我的目標是:
- 當我在Y方向上滾動時,我想滾動視圖接管並正常滾動
- 當我在X方向的滾動我想滾動視圖下viewpager現在接手
的問題是,滾動視圖通吃事件和viewpager不能在所有的到達。
關於如何解決這個問題的任何想法?