Below is my .XML code. Could I have a solution to this problem.
<ScrollView 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:id="@+id/ticket_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:isScrollContainer="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</ScrollView>
Try This I think It may help you.
<ScrollView 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:id="@+id/ticket_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:isScrollContainer="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</ScrollView>
Thie LinearLayout should have android:layout_height="wrap_content"
Reason for that is that if the scrollview's child is the same size as the scrollview itself (both match_parent for height) it means that there is nothing to scroll through, since they are of same size and the scrollview will only be as high as the screen.
If the LinearLayout has a height of wrap_content then the height is not related to the height of the screen and the scrollview will be able to scroll through it.
Just remember that a scrollview can only have one direct child and that child needs android:layout_height="wrap_content"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With