android.support.design.widget.TabLayout not working properly with ViewPager
<p>android.support.design.widget.TabLayout not working properly with ViewPager
If I set tabLayout.setupWithViewPager(viewPager); then tablayout view not showing please find attached screen shots.</p>

<p><a href="https://i.stack.imgur.com/oe3Na.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oe3Na.png" alt="enter image description here"></a></p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="false"
android:orientation="vertical"
tools:context=".home.HomeActivity"
tools:showIn="@layout/activity_home"&gt;

&lt;android.support.design.widget.TabLayout
    android:id="@+id/tab_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/colorPrimary"
    android:elevation="6dp"
    android:minHeight="?attr/actionBarSize"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/&gt;

&lt;android.support.v4.view.ViewPager
    android:id="@+id/pager"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:layout_below="@id/tab_layout"/&gt;
</code></pre>

<p></p>

<p>Fragment Code :</p>

<pre><code>TabLayout tabLayout = (TabLayout) view.findViewById(R.id.tab_layout);       tabLayout.addTab(tabLayout.newTab().setText(getActivity().getResources().getText(R.string.feeds)));        tabLayout.addTab(tabLayout.newTab().setText(getActivity().getResources().getText(R.string.following)));        tabLayout.addTab(tabLayout.newTab().setText(getActivity().getResources().getText(R.string.you)));
    tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
    final ViewPager viewPager = (ViewPager) view.findViewById(R.id.pager);
    final PageAdapter adapter = new PageAdapter(getChildFragmentManager(), 3);
    viewPager.setOffscreenPageLimit(3);
    viewPager.setAdapter(adapter);
    tabLayout.setupWithViewPager(viewPager);
</code></pre>

<p>When remove "tabLayout.setupWithViewPager(viewPager);" the view is working fine. But I need navigate respective fragment when click on respective tab.</p>

<p><a href="https://i.stack.imgur.com/qLwdE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qLwdE.png" alt="enter image description here"></a></p>