CardView bottom border is cut off inside ScrollView android
<p>I am putting the cardview inside scrollview, we expect to see that at the bottom, the border should be shown（see pic below）. But its not. The problem is that I cannot scroll to the bottom to see the border of cardview.</p>

<p>All the solutions on SO is to change layout_margins to paddings, but its not the case for cardview if we want to show the border. I basically tried everything. But still doesnt work.
<a href="https://i.stack.imgur.com/uXR6j.png" rel="noreferrer"><img src="https://i.stack.imgur.com/uXR6j.png" alt="scroll to bottom cannot see the border"></a></p>

<p>Picture 1. scroll to bottom cannot see the border</p>

<p><a href="https://i.stack.imgur.com/6o536.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6o536.png" alt="we can see the top border"></a></p>

<p>Picture 2. We can see the top border</p>

<p>Following is xml code</p>

<pre><code>&lt;LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
&gt;
    &lt;ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fillViewport="true"&gt;

            &lt;android.support.v7.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="8dp"&gt;
                    &lt;LinearLayout
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:orientation="vertical"
                      &gt;
                     ...
                    &lt;/LinearLayout&gt;
           &lt;/CardView&gt;
  &lt;/LinearLayout&gt;
</code></pre>

<p>references: 
<a href="https://stackoverflow.com/questions/15131962/scrollview-doesnt-scroll-to-the-bottom?rq=1">ScrollView doesn&#39;t scroll to the bottom</a></p>

<p><a href="https://stackoverflow.com/questions/15922866/scrollview-cuts-off-the-top-and-leaves-space-at-the-bottom">ScrollView cuts off the top and leaves space at the bottom</a></p>

<p><a href="https://stackoverflow.com/questions/9937681/i-cant-show-linearlayout-at-bottom-to-scroll-view">I can&#39;t show LinearLayout at bottom to scroll view</a></p>

<p><a href="https://stackoverflow.com/questions/11660937/android-scrollview-refuses-to-scroll-to-bottom">Android ScrollView refuses to scroll to bottom</a></p>