1

親ビューよりも広い ListView があります。水平スクロールを行うために、Horizo​​ntalScrollView でラップしました。

簡素化されたレイアウト XML:

<HorizontalScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <RelativeLayout
        android:id="@+id/main"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <ListView 
            android:id="@+id/children"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            />
    </RelativeLayout>
</HorizontalScrollView>

そのため、ListView に垂直スクロールバーがあり、Horizo​​ntalScrollView に水平スクロールバーがあります。

私の問題は、Horizo​​ntalScrollView が右端までスクロールされない限り、垂直リスト スクロールバーが表示されないことです。ListView の右端に沿って垂直スクロールバーがあるためです。

Horizo​​ntalScrollView の右端に沿って垂直スクロール バーを表示する方法はありますか? リストの垂直スクロールバーを任意の Horizo​​ntalScrollView 位置で表示できるようにします。

4

1 に答える 1

1

代わりにこれを試してください:

<HorizontalScrollView 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:scrollbars="none">

            <LinearLayout android:id="@+id/main"
                    android:layout_width="wrap_content"
                    android:layout_height="fill_parent"
                    android:orientation="horizontal">

                    <ListView android:id="@+id/children"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent" />
        </LinearLayout>
</HorizontalScrollView>
于 2013-03-09T15:42:28.550 に答える