CoordinatorBehaviorExample
CoordinatorBehaviorExample copied to clipboard
Also how can we use tablayout with this layout, can you please explain me that...
Editing my own answer, I've got a much cleaner solution. Just put the TabLayout on top of the NestedScrollView and above the TabLayout put a space of the Toolbar height. After that set the overlap of the NestedScrollView to be the same height as the space and you are set!
During scroll the space is barely visible.
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
app:behavior_overlapTop="?attr/actionBarSize"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Space
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" />
<android.support.design.widget.TabLayout>