title: How to fix bottom navigation bar below Scroll View in Android?
body: <p>I have an activity that has multiple card views inside a nested scroll View. I want to fix the navigation bar at the bottom. But whenever i try to put a bar below a Scrollable content, content covers the bar as well. I have tried wrapping it in a constraint Layout view but that doesn't works either. Here is my layout file.</p>
  
  <pre><code>&lt;androidx.constraintlayout.widget.ConstraintLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  
  
          &lt;androidx.core.widget.NestedScrollView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:id="@+id/scroll_view"&gt;
  
              &lt;LinearLayout
                  android:orientation="vertical"
                  android:layout_height="match_parent"
                  android:layout_width="match_parent"&gt;
  
                  &lt;androidx.cardview.widget.CardView
                      xmlns:card_view="http://schemas.android.com/apk/res-auto"
                      android:id="@+id/card_view"
                      android:layout_width="match_parent"
                      android:layout_height="199dp"
                      android:layout_gravity="center"
                      card_view:cardCornerRadius="4dp"
                      android:layout_marginTop="5dp"
                      android:layout_marginBottom="5dp"
                      android:layout_marginLeft="5dp"
                      android:layout_marginRight="5dp"&gt;
  
                      &lt;TextView
  
                          android:id="@+id/info_text"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content" /&gt;
  
                  &lt;/androidx.cardview.widget.CardView&gt;
  
                  &lt;androidx.cardview.widget.CardView
                      xmlns:card_view="http://schemas.android.com/apk/res-auto"
  
                      android:id="@+id/card_view1"
                      android:layout_width="match_parent"
                      android:layout_height="200dp"
                      android:layout_gravity="center"
                      card_view:cardCornerRadius="5dp"
                      android:layout_marginBottom="5dp"
                      android:layout_marginLeft="5dp"
                      android:layout_marginRight="5dp"&gt;
  
                      &lt;TextView
  
                          android:id="@+id/info_text1"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content" /&gt;
  
                  &lt;/androidx.cardview.widget.CardView&gt;
                  &lt;androidx.cardview.widget.CardView
                      xmlns:card_view="http://schemas.android.com/apk/res-auto"
  
                      android:id="@+id/card_view2"
                      android:layout_width="match_parent"
                      android:layout_height="200dp"
                      android:layout_gravity="center"
                      card_view:cardCornerRadius="5dp"
                      android:layout_marginBottom="5dp"
                      android:layout_marginLeft="5dp"
                      android:layout_marginRight="5dp"&gt;
  
                      &lt;TextView
  
                          android:id="@+id/info_text2"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content" /&gt;
  
                  &lt;/androidx.cardview.widget.CardView&gt;
  
                  &lt;androidx.cardview.widget.CardView
                      xmlns:card_view="http://schemas.android.com/apk/res-auto"
  
                      android:id="@+id/card_view3"
                      android:layout_width="match_parent"
                      android:layout_height="200dp"
                      android:layout_gravity="center"
                      card_view:cardCornerRadius="5dp"
                      android:layout_marginBottom="5dp"
                      android:layout_marginLeft="5dp"
                      android:layout_marginRight="5dp"&gt;
  
                      &lt;TextView
  
                          android:id="@+id/info_text3"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content" /&gt;
  
                  &lt;/androidx.cardview.widget.CardView&gt;
  
              &lt;/LinearLayout&gt;
  
  
          &lt;/androidx.core.widget.NestedScrollView&gt;
  
  
      &lt;com.google.android.material.bottomnavigation.BottomNavigationView
          android:id="@+id/nav_view"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_marginStart="0dp"
          android:layout_marginEnd="0dp"
          android:layout_gravity="bottom"
          android:background="?android:attr/windowBackground"
          app:layout_constraintTop_toBottomOf="@id/scroll_view"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toRightOf="parent"
          app:menu="@menu/bottom_nav_menu" /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p>Any kind of help is appreciated. </p>