title: Add toolbar to Bottom Navigation
body: <p>I want to add a toolbar in my bottom navigation view. I try to add a Toolbar but it doesn't add it to the top</p>
  
  <p><a href="https://i.stack.imgur.com/Y4yGh.png" rel="nofollow noreferrer">toolbar_image</a></p>
  
  <p>It might be the "android:paddingTop="?attr/actionBarSize">"
  I don't undestand it use but when I remove it, I can't see the design of the layout</p>
  
  <p>nav_bar.xml code:</p>
  
  <pre><code>&lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/container"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingTop="?attr/actionBarSize"&gt;
  
      &lt;androidx.appcompat.widget.Toolbar
              android:id="@+id/toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="?attr/colorPrimary"
              app:popupTheme="@style/AppTheme.PopupOverlay" /&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:background="?android:attr/windowBackground"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toRightOf="parent"
          app:menu="@menu/navigation_destinations" /&gt;
  
      &lt;fragment
          android:id="@+id/nav_host_fragment"
          android:name="androidx.navigation.fragment.NavHostFragment"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_marginTop="?attr/actionBarSize"
          app:defaultNavHost="true"
          app:layout_constraintBottom_toTopOf="@id/nav_view"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:navGraph="@navigation/mobile_navigation" /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>