1

ギャラリー内のScrollViewsなどについていくつか質問がありましたが、ここでは正反対のものがあり、解決策が見つかりません。

問題:1つのScrollViewに複数のギャラリーがあります。ギャラリーの水平スクロールは正常に機能しますが(ここでは何も変更されていません。SDKの標準のGalleryクラスのみ)、アクティビティ全体のScrollViewの垂直スクロールは機能しません。ギャラリーがタッチイベントを傍受しているようです。これを解決するのを手伝ってくれませんか。

これは私のレイアウトxmlです:

    <ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scrollview_home"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">
    <RelativeLayout
        android:id="@+id/layout_home"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <RelativeLayout
            ...>
            <Button
                .../>
            <Gallery
                xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/gallery_..."
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                ... />
            <TextView
                ... />
        </RelativeLayout>//this layout is repeated few times, because I have multiple galleries
    </RelativeLayout>
</ScrollView>

ありがとう!

4

1 に答える 1

1

一番上の RelativeLayout (他のすべての RelativeLayouts を含む) を、ScrollView よりも幅が約 30 ~ 40 dp 小さくすることができます。これにより、ギャラリーでカバーされていない ScrollView の領域をユーザーがタッチできるようになるため、Touch はインターセプトされず、期待どおりに動作するはずです。

于 2011-09-20T10:44:58.877 に答える