how to use horizontal scrollview in android studio

horizontal scrollview in android studio

Main activity.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:id="@+id/layout"
android:layout_height="match_parent">

<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<ImageView
android:id="@+id/imageView12"
android:layout_width="200dp"
android:layout_height="200dp"
app:srcCompat="@drawable/physicalimmunity" />

<ImageView
android:id="@+id/imageView13"
android:layout_width="200dp"
android:layout_height="200dp"
app:srcCompat="@drawable/quotesbyauthor" />

<ImageView
android:id="@+id/imageView14"
android:layout_width="200dp"
android:layout_height="200dp"
app:srcCompat="@drawable/quotesbyauthor" />

<ImageView
android:id="@+id/imageView15"
android:layout_width="200dp"
android:layout_height="200dp"
app:srcCompat="@drawable/quotesbyauthor" />

<ImageView
android:id="@+id/imageView16"
android:layout_width="200dp"
android:layout_height="200dp"
app:srcCompat="@drawable/quotesbyauthor" />


</LinearLayout>
</HorizontalScrollView>
</LinearLayout>

Android Development