title: How to set Collapsing ToolBar height
body: <p>I am using Collapse ToolBar to make the layout as follow.But the ToolBar is not set properly. Now I am setting ToolBar Height as 100dp. If I reduce it, the ViewPager where the Tabs are set is overlapped on the ToolBar.</p>
  
  <p><a href="https://i.stack.imgur.com/AaVSX.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AaVSX.png" alt="enter image description here"></a></p>
  
  <p>This is my xml.</p>
  
  <p>
  
  
  <pre><code>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/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      tools:openDrawer="start"&gt;
  
  
      &lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fitsSystemWindows="false"&gt;
  
          &lt;android.support.design.widget.AppBarLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:fitsSystemWindows="true"
              android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
  
              &lt;android.support.design.widget.CollapsingToolbarLayout
                  android:id="@+id/collapse_toolbar"
                  android:layout_width="match_parent"
                  android:layout_height="250dp"
                  android:fitsSystemWindows="true"
                  app:contentScrim="?attr/colorPrimary"
                  app:layout_scrollFlags="scroll|exitUntilCollapsed"&gt;
  
  
                  &lt;ImageView
                      android:id="@+id/header"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:src="@drawable/slide_image"
                      android:background="@drawable/slide_transparent"
                      android:fitsSystemWindows="true"
                      android:scaleType="centerCrop"
                      app:layout_collapseMode="parallax" /&gt;
  
                  &lt;TextView
                      android:id="@+id/dashboard_txt_title"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_marginTop="60dp"
                      android:gravity="center|bottom"
                      android:text="Salad"
                      android:textColor="@color/white"
                      android:textSize="25dp"
                      android:textStyle="italic" /&gt;
  
                  &lt;TextView
                      android:id="@+id/dashboard_txt_des"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_marginTop="100dp"
                      android:gravity="center|bottom"
                      android:text="@string/welcome_des"
                      android:textColor="@color/white"
                      android:textSize="15dp" /&gt;
  
  
                  &lt;android.support.v7.widget.Toolbar
                      android:id="@+id/toolbar"
                      android:layout_width="match_parent"
                      android:layout_height="100dp"
                      android:gravity="top"
                      android:minHeight="?attr/actionBarSize"
                      android:background="@drawable/toolbar_layout"
                      app:layout_collapseMode="pin"
                      app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                      app:titleMarginTop="15dp"
                      app:titleTextAppearance="@style/Toolbar.TitleText" /&gt;
  
  
                  &lt;android.support.design.widget.TabLayout
                      android:id="@+id/tabs"
                      android:layout_width="match_parent"
                      android:layout_height="?attr/actionBarSize"
                      android:layout_gravity="bottom"
                      android:background="@color/colorPrimary"
                      app:tabIndicatorColor="@color/white" /&gt;
  
  
              &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  
  
              &lt;!--&lt;include layout="@layout/activity_collapse_toolbar" /&gt;--&gt;
          &lt;/android.support.design.widget.AppBarLayout&gt;
  
          &lt;android.support.v4.view.ViewPager
              android:id="@+id/viewpager"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              app:layout_behavior="@string/appbar_scrolling_view_behavior" /&gt;
  
      &lt;/android.support.design.widget.CoordinatorLayout&gt;
  
      &lt;!--&lt;android.support.design.widget.NavigationView
          android:id="@+id/nav_view"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:fitsSystemWindows="true"
          app:headerLayout="@layout/nav_header_main"
          app:menu="@menu/activity_main_drawer" /&gt;--&gt;
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v4.widget.DrawerLayout 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/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      tools:openDrawer="start"&gt;
  
  
      &lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fitsSystemWindows="false"&gt;
  
          &lt;android.support.design.widget.AppBarLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:fitsSystemWindows="true"
              android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
  
              &lt;android.support.design.widget.CollapsingToolbarLayout
                  android:id="@+id/collapse_toolbar"
                  android:layout_width="match_parent"
                  android:layout_height="250dp"
                  android:fitsSystemWindows="true"
                  app:contentScrim="?attr/colorPrimary"
                  app:layout_scrollFlags="scroll|exitUntilCollapsed"&gt;
  
  
                  &lt;ImageView
                      android:id="@+id/header"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:layout_below="@+id/collapse_toolbar"
                      android:foreground="@drawable/slide_transparent"
                      android:fitsSystemWindows="true"
                      android:scaleType="centerCrop"
                      android:src="@drawable/slide_image"
                      app:layout_collapseMode="parallax" /&gt;
  
                  &lt;TextView
                      android:id="@+id/dashboard_txt_title"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_below="@+id/header"
                      android:layout_marginTop="60dp"
                      android:gravity="center|bottom"
                      android:text="Salad"
                      android:textColor="@color/white"
                      android:textSize="25dp"
                      android:textStyle="italic" /&gt;
  
                  &lt;TextView
                      android:id="@+id/dashboard_txt_des"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_marginTop="100dp"
                      android:layout_below="@+id/dashboard_txt_title"
                      android:gravity="center|bottom"
                      android:text="@string/welcome_des"
                      android:textColor="@color/white"
                      android:textSize="15dp" /&gt;
  
  
                  &lt;android.support.v7.widget.Toolbar
                      android:id="@+id/toolbar"
                      android:layout_width="match_parent"
                      android:layout_height="100dp"
                      android:layout_below="@+id/dashboard_txt_des"
                      android:background="@drawable/toolbar_layout"
                      android:gravity="top"
                      android:minHeight="?attr/actionBarSize"
                      app:layout_collapseMode="pin"
                      app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                      app:titleMarginTop="15dp"
                      app:titleTextAppearance="@style/Toolbar.TitleText" /&gt;
  
  
                  &lt;android.support.design.widget.TabLayout
                      android:id="@+id/tabs"
                      android:layout_width="match_parent"
                      android:layout_height="?attr/actionBarSize"
                      android:layout_below="@+id/toolbar"
                      android:layout_gravity="bottom"
                      android:background="@color/colorPrimary"
                      app:tabIndicatorColor="@color/white" /&gt;
  
  
              &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  
  
              &lt;!--&lt;include layout="@layout/activity_collapse_toolbar" /&gt;--&gt;
          &lt;/android.support.design.widget.AppBarLayout&gt;
  
          &lt;android.support.v4.view.ViewPager
              android:id="@+id/viewpager"
              android:layout_below="@+id/collapse_toolbar"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              app:layout_behavior="@string/appbar_scrolling_view_behavior" /&gt;
  
      &lt;/android.support.design.widget.CoordinatorLayout&gt;
  
      &lt;!--&lt;android.support.design.widget.NavigationView
          android:id="@+id/nav_view"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:fitsSystemWindows="true"
          app:headerLayout="@layout/nav_header_main"
          app:menu="@menu/activity_main_drawer" /&gt;--&gt;
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>Expect Result:<a href="https://i.stack.imgur.com/4jHab.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/4jHab.jpg" alt="enter image description here"></a></p>