here is my XML code which I am trying. I wrote the code in the right way but I can't get the results I want so please tell me where I am mistaken in coding thanks in advance for the help.
<ScrollView
android:id="@+id/tabLOScroll"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/toolBarClr"
android:fillViewport="true"
android:scrollbars="horizontal"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/appBar">
<LinearLayout
android:id="@+id/tabLO"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:orientation="horizontal">
<include
layout="@layout/custome_tab_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="20dp" />
<include
layout="@layout/custome_tab_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp" />
<include
layout="@layout/custome_tab_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp" />
<include
layout="@layout/custome_tab_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp" />
<include
layout="@layout/custome_tab_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp" />
</LinearLayout>
</ScrollView>
this just shows 4 tabs but I add 5 I want to scroll to see the 5th but the horizontal scroll not working
ScrollViewsupports vertical scrolling only. If you want horizontal scrolling, you need to useHorizontalScrollView. The documentation forScrollViewactually says exactly this.