How to make one of child view of nestedscrollview to sticky header? : <p>Below is my code snipet.</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"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/coordinate"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/background_light"
    tools:context="com.ajinkyabadve.mywatchlist.movie_detail_new.MovieActivity"&gt;    &lt;ProgressBar
        android:id="@+id/progressBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:visibility="gone" /&gt;

    &lt;include
        android:id="@+id/retryLayoutNoInternet"
        layout="@layout/no_internet_retry_layout"
        android:visibility="gone" /&gt;
    &lt;android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="400dp"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;

        &lt;android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsingToolbarLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:contentScrim="?attr/colorPrimary"
            app:expandedTitleMarginEnd="64dp"
            app:expandedTitleMarginStart="48dp"
            app:layout_scrollFlags="scroll|enterAlwaysCollapsed"&gt;

            &lt;ImageView
                android:id="@+id/poster"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:contentDescription="@string/poster_of_movie"
                android:fitsSystemWindows="true"
                android:scaleType="centerCrop"
                app:layout_collapseMode="parallax" /&gt;

        &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;

    &lt;/android.support.design.widget.AppBarLayout&gt;
&lt;include
        android:id="@+id/content"
        layout="@layout/content_movie" /&gt;

    &lt;android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="112dp"
        android:background="@color/colorPrimary"
        android:elevation="4dp"
        app:layout_anchor="@id/appbar"
        app:layout_anchorGravity="bottom"
        app:layout_collapseMode="pin"
        app:theme="@style/ThemeOverlay.AppCompat.Light"&gt;

        &lt;LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginBottom="8dp"
            android:minHeight="?android:attr/actionBarSize"
            android:orientation="vertical"&gt;

            &lt;TextView
                android:id="@+id/movieTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Title"
                android:textAppearance="@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse" /&gt;

            &lt;TextView
                android:id="@+id/movieOrignalTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:text="subtitle"
                android:textAppearance="@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle.Inverse" /&gt;
        &lt;/LinearLayout&gt;
    &lt;/android.support.v7.widget.Toolbar&gt;
</code></pre>

<p></p>

<p>And below is content_movie.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;android.support.v4.widget.NestedScrollView 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/content_movie"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.ajinkyabadve.mywatchlist.movie_detail_new.MovieActivity"
    tools:showIn="@layout/activity_movie"&gt;

    &lt;LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"&gt;

        &lt;include layout="@layout/overview" /&gt;

        &lt;include layout="@layout/cast" /&gt;

        &lt;include layout="@layout/facts" /&gt;


&lt;!-- Below tablayout I want to work as a sticky header --&gt;
        &lt;!--&lt;android.support.design.widget.TabLayout--&gt;
        &lt;!--android:layout_width="match_parent"--&gt;
        &lt;!--android:layout_height="100dp"--&gt;
        &lt;!--android:background="@color/colorPrimary" /&gt;--&gt; &lt;/LinearLayout&gt;
&lt;/android.support.v4.widget.NestedScrollView&gt;
</code></pre>

<p>The commented tablayout should work as a sticky header(meaning it should not scroll when it reaches to top while scrolling).How to achive this  effect using the coordinate layout?OR In any other way.Can we use custom behavior or something?</p>
