title: Coordinator layout does not display in order
body: <p>I have a <code>TextView</code> inside a <code>NestedScrollView</code> </p>
  
  <p>My XML: </p>
  
  <pre><code>&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="true"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:id="@+id/appbar"
          android:layout_width="match_parent"
          android:layout_height="250dp"
          android:fitsSystemWindows="true"
          android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
          &lt;android.support.design.widget.CollapsingToolbarLayout
              android:id="@+id/collapsing_toolbar"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:fitsSystemWindows="true"
              app:contentScrim="?attr/colorPrimary"
              app:expandedTitleMarginBottom="32dp"
              app:expandedTitleMarginEnd="64dp"
              app:expandedTitleMarginStart="48dp"
              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/header"
                  android:fitsSystemWindows="true"
                  android:scaleType="centerCrop"
                  app:layout_collapseMode="parallax" /&gt;
  
              &lt;android.support.v7.widget.Toolbar
                  android:id="@+id/anim_toolbar"
                  android:layout_width="match_parent"
                  android:layout_height="?attr/actionBarSize"
                  app:layout_collapseMode="pin"
                  app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                  app:layout_scrollFlags="scroll|enterAlways"/&gt;
  
          &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.widget.NestedScrollView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"
          android:background="#AAA"
          &gt;
  
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:textSize="20sp"
              android:lineSpacingExtra="8dp"
              android:text="@string/lorem"
              android:padding="@dimen/activity_horizontal_margin"
              android:textColor="#FFF"/&gt;
  
      &lt;/android.support.v4.widget.NestedScrollView&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>But the <code>TextView</code> is not displayed before scrolling
  It's just a black screen below the image
  <a href="https://i.stack.imgur.com/VlOpu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VlOpu.png" alt="TextView not displayed before scrolling"></a></p>
  
  <p>And TextView is dragged along while scrolling</p>
  
  <p><a href="https://i.stack.imgur.com/JMM1V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JMM1V.png" alt="TextView is dragged along while scrolling"></a></p>
  
  <p>Java code:</p>
  
  <pre><code>    public android.support.v7.widget.Toolbar toolbar;
      public CollapsingToolbarLayout collapsingToolbar;
  
  @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
       setContentView(R.layout.event_details2);
              toolbar = (android.support.v7.widget.Toolbar) findViewById(R.id.anim_toolbar);
              setSupportActionBar(toolbar);
              collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
              collapsingToolbar.setTitle("Event Name");
              ImageView header = (ImageView) findViewById(R.id.header);
              collapsingToolbar.setContentScrimColor(getResources().getColor(R.color.colorPrimary));
          }
  </code></pre>
  
  <p>How can I correct this? What am I doing wrong here?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Using TextView inside a LinearLayout which is inside the NestedScrollView solved this problem. But why is the LinearLayout required? Why am I not able to use TextView directly under NestedScrollView?</p>