How to make ListView to scroll horizontally in android studio?

Viewed 25

I have a Listview and array of data which will shows in Listview vertically. But I want to make that Listview to scroll horizontally. How to do that.

xml

<ListView
      android:id="@+id/filter_list"
      android:layout_width="120dp"
      android:layout_height="0dp"
      android:verticalScrollbarPosition="left"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintTop_toTopOf="parent"
      app:layout_constraintBottom_toTopOf="@id/img_album"
      android:layout_marginTop="40dp"
      android:layout_marginBottom="20dp"
      tools:ignore="MissingConstraints" />

Java

   final List<FilterType> filterTypes = FilterType.createFilterList();
      lv.setAdapter(new FilterAdapter(this, R.layout.row_white_text, 
     filterTypes).whiteMode());

R.layout.row_white_text

    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/label"
      style="@style/ServiceTextShadow"
      android:layout_width="wrap_content"
      android:layout_height="?android:attr/listPreferredItemHeight"
      android:gravity="center_vertical"
      android:padding="12dp"
      android:textAppearance="?android:attr/textAppearanceListItem"
      android:textColor="@android:color/white"
      android:textSize="12sp"
      android:textStyle="bold"/>
0 Answers
Related