title: Toolbar not displaying from inside collapsing toolbar
body: <p>Here is the code.  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&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:id="@+id/main"
      android:layout_height="match_parent"
      android:layout_width="match_parent"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:layout_width="match_parent"
          android:layout_height="100dp"&gt;
  
          &lt;android.support.design.widget.CollapsingToolbarLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              app:layout_scrollFlags="scroll|enterAlways|exitUntilCollapsed"&gt;
  
              &lt;android.support.v7.widget.Toolbar
                  android:id="@+id/mytoolbar"
                  android:layout_width="match_parent"
                  android:layout_height="?attr/actionBarSize"
                  app:title="@string/app_name"
                  app:layout_collapseMode="pin"
                  app:theme="@style/ThemeOverlay.AppCompat.Light"/&gt;
  
              &lt;android.support.design.widget.TabLayout
                  android:id="@+id/main_tablayout"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_gravity="bottom"
                  app:layout_collapseMode="none"/&gt;
  
  
      &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;!--&lt;android.support.v4.widget.NestedScrollView--&gt;
          &lt;!--android:id="@+id/nestedscroll"--&gt;
          &lt;!--android:layout_width="match_parent"--&gt;
          &lt;!--android:layout_height="match_parent"--&gt;
          &lt;!--android:fillViewport="true"--&gt;
          &lt;!--android:scrollbars="horizontal"--&gt;
          &lt;!--app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;--&gt;
  
              &lt;android.support.v4.view.ViewPager
                  android:id="@+id/main_viewpager"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  app:layout_behavior="@string/appbar_scrolling_view_behavior"/&gt;
  
      &lt;!--&lt;/android.support.v4.widget.NestedScrollView&gt;--&gt;
  
      &lt;android.support.design.widget.FloatingActionButton
          android:id="@+id/main_fab"
          android:layout_margin="16dp"
          android:src="@android:drawable/ic_media_play"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          app:layout_anchor="@id/main_viewpager"
          app:layout_anchorGravity="bottom|end"/&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p><strong>The problem:</strong><br>
  1) Toolbar is not visible.<br>
  2) Collapsing toolbar doesn't collapse at all. [Solved]<br>
  3) Viewpager and FAB also not visible if put inside nestedScrollView. [Solved]</p>
  
  <p><strong>Extra detail:</strong><br>
  Layout for fragments of Viewpager have Linearlayout as root and inside that have a recyclerview.</p>
  
  <p>Everything seems to be alright as per the code. Unable to understand what is missing. A good explanation of how coordinator layout and collapsing toolbar work together would also indeed help.</p>