XML
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Button1"
tools:layout_editor_absoluteX="145dp"
tools:layout_editor_absoluteY="16dp" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Button2"
tools:layout_editor_absoluteX="145dp"
tools:layout_editor_absoluteY="83dp" />
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Button3"
tools:layout_editor_absoluteX="145dp"
tools:layout_editor_absoluteY="144dp" />
<Button
android:id="@+id/button4"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Button4"
tools:layout_editor_absoluteX="145dp"
tools:layout_editor_absoluteY="209dp" />
<Button
android:id="@+id/button5"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Button5"
tools:layout_editor_absoluteX="145dp"
tools:layout_editor_absoluteY="281dp" />
<Button
android:id="@+id/button6"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Button6"
tools:layout_editor_absoluteX="145dp"
tools:layout_editor_absoluteY="341dp" />
<Button
android:id="@+id/button7"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Button7"
tools:layout_editor_absoluteX="145dp"
tools:layout_editor_absoluteY="405dp" />
<Button
android:id="@+id/button8"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Button8"
tools:layout_editor_absoluteX="145dp"
tools:layout_editor_absoluteY="470dp" />
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>