Search code examples
androidscrollview

ScrollView not able to scroll at all


I have looked through similar questions and not looking for generalize answers but rather want to know why my below code is not working. I am generating the rest of the child inside LinearLayout programmatically. The only issue is that it is not scrolling. Please find below the code for the bottom-most card.

<ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@+id/card2"
        tools:layout_editor_absoluteX="1dp"
        android:layout_margin="15dp"
        android:background="@drawable/scrollview">

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

Please find below the screenshot how it looks like. The scroll view should allow me to scroll for remaining future days in the bottom-most card but it only shows what fits on screen with no scrolling.

in


Solution

  • Try adding bottom constraint to scrollview app:layout_constraintBottom_toBottomOf="parent"and change android:layout_height="wrap_content" to android:layout_height="0dp"