Hello.
There is a CardView , inside of which is a TextView . The CardView itself CardView wrapped in a ScrollView :
<?xml version="1.0" encoding="utf-8"?> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="50dp" android:layout_marginLeft="50dp"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorAccent" android:text="здесь большой текст"/> </android.support.v7.widget.CardView> </ScrollView> As you can see from the markup code, the fields on the left and right have CardView added to CardView - and they really are and are displayed correctly.
You need to add top and bottom fields to CardView .
Adding android:layout_marginTop to CardView leads to the addition of a field at the top, but in this case ScrollView does not scroll to the end.
Adding android:layout_marginBottom to CardView does not make any changes at all.
Tell me, please, how to correctly add these fields.
Ps. In fact, the markup is much more complicated, it is only a minimal reproducible example.
paddingandclopToPadding="false"inScrollView? - lllyctCardViewaddlayout_marginLeftandlayout_marginRight, and toandroid:clipToPadding="false"toScrollViewandroid:clipToPadding="false",paddingTopandpaddingBottom, then you almost get what you need. But in this case, the scrollbar starts from the end of the upper indent and ends at the beginning of the lower one, but I would like it to be equal in height to both the paddings. - Burence