1

I'm new to this and trying to build an activity in Java in Android Studio that uses a Scroll View to show a ViewPager and a tile that will contain a ListView.

My current code shows the ViewPager perfectly but not the ListView and doesn't allow me to scroll.

Please anyone help me find a solution!

My XML is:

<ScrollView
    android:id="@+id/scrollView2"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    app:layout_constraintBottom_toTopOf="@+id/logoutButton"
    app:layout_constraintTop_toBottomOf="@+id/helloText"
    android:fillViewport="true">

    <LinearLayout
        android:id="@+id/linearLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <androidx.viewpager.widget.ViewPager
            android:id="@+id/viewPager"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:clipToPadding="false"
            android:foregroundGravity="center"
            android:overScrollMode="never">

        </androidx.viewpager.widget.ViewPager>

        <ListView
            android:id="@+id/toDoListView"
            android:layout_width="200dp"
            android:layout_height="wrap_content" />


    </LinearLayout>
</ScrollView>

0 Answers0