1

I have ListView which is wider than parent view. To have horizontal scrolling I've wrapped it with HorizontalScrollView.

Simplified layout 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>

So that I have vertical scrollbar in the ListView and horizontal scrollbar in the HorizontalScrollView.

My problem is that I don't see vertical list scrollbar unless the HorizontalScrollView isn't scrolled to the rightest position. Because vertical scrollbar along the right edge of the ListView.

Is there a way to make vertical scrollbar visible along the right edge of HorizontalScrollView? To make list vertical scrollbar visible in any HorizontalScrollView position.

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 回答