Reputation: 2015
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.
Upvotes: 1
Views: 1169
Reputation: 199805
Try this instead:
<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>
Upvotes: 1