0

Hi I am trying to make a ListView that scrolls horizontally rather than vertically.

I am trying this code to make ListView scroll Horizontally and I found this code on StackOverflow as well.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#596287">

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:minHeight="380dp"
    android:minWidth="380dp"
    android:id="@+id/imageView"
    android:layout_marginTop="5dp"
    android:layout_alignParentTop="true" />

    <HorizontalScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_below="@+id/imageView"
        android:layout_marginTop="5dp">
            <ListView
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:id="@+id/listView"
                android:layout_weight="1">
            </ListView>
    </HorizontalScrollView>

I am just trying to make an app that has an ImageView and the horizontal ListView in it. Like many of the Photo Editing App or something like that.

But the ListView is not scrolling horizontally. Please help me.

1 Answers1

0

ListView is not designed to do this, but RecyclerView is. See this answer.

Community
  • 1
  • 1
RussHWolf
  • 3,555
  • 1
  • 19
  • 26