4

画像や動画を含むビューページャーがあり、スクロールして詳細を表示するPlayストアアプリのような要件があります。残念ながら、ユーザーがスクロールするとスクロールがジャンプしますが、スクロールビューを削除すると、ビューページャーは完全に正常に機能します。

レイアウトのルックアンドフィールは次のようなものです http://cl.ly/MBRB

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"  android:fillViewport="true">

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >



    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="160dp"
        android:background="@drawable/loading_image"
        android:gravity="top"
        android:orientation="vertical" >

        <android.support.v4.view.ViewPager
            android:id="@+id/product_image_pager"
            android:layout_width="fill_parent"
            android:layout_height="match_parent" />

        <com.viewpagerindicator.CirclePageIndicator
            android:id="@+id/titles"
            style="@style/CirclePageIndicator"
            android:layout_alignParentBottom="true"
            android:padding="10dip"
            android:paddingBottom="10dp" />
    </RelativeLayout>

    <include layout="@layout/app_screen_menu" />
</LinearLayout>
</ScrollView>

ところで、私はサーバーから画像を読み込んでいます。

ありがとう

4

1 に答える 1

6

2つのscrollistenerを使用しています

  • ビューページャーはスクロールリスナーを使用します
  • scrollviewはscrolllistenerを使用します

これらの2つのscrollistenerはScrollEventのために戦っています。を実装することでこれを解決できますonInterceptTouch。このメソッドでは、ScrollEventをめぐる戦いに誰が勝つかを決めることができます

2つのスクロールビューを含む類似の問題に関するこの保護された投稿を見てください

于 2013-01-14T21:16:26.477 に答える