title: Why is my ViewPager not showing?
body: <p>I have a main activity that creates a fragment, which in turn has a TabLayout and a ViewPager in it. I found out that when I use an activity instead of a fragment, it works fine, but i want to utilize a fragment. My code for the fragment is as follows:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  using Android.App;
  using Android.Content;
  using Android.OS;
  using Android.Runtime;
  using Android.Util;
  using Android.Views;
  using Android.Widget;
  using Android.Support.Design.Widget;
  using Android.Support.V4.View;
  using SupportFragmentManager = Android.Support.V4.App.FragmentManager;
  using SupportFragment = Android.Support.V4.App.Fragment;
  using Android.Support.V4.App;
  using Java.Lang;
  
  namespace Zrelya.Fragments
  {
      public class Stats : FragmentSuper
      {
          public override void OnCreate(Bundle savedInstanceState)
          {
              base.OnCreate(savedInstanceState);
  
              // Create your fragment here
          }
  
          public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
          {
              // Use this to return your custom view for this Fragment
              var view = inflater.Inflate(Resource.Layout.Stats, container, false);
  
  
              TabLayout tabs = view.FindViewById&lt;TabLayout&gt;(Resource.Id.tabs);
              ViewPager viewPager = view.FindViewById&lt;ViewPager&gt;(Resource.Id.viewpager);
              SetUpViewPager(viewPager);
              tabs.SetupWithViewPager(viewPager);
  
  
              return view;
          }
  
          private void SetUpViewPager(ViewPager viewPager)
          {
              TabAdapter adapter = new TabAdapter(Activity.SupportFragmentManager);
              adapter.AddFragment(new Fragments.StatsTraining(), "Training");
              adapter.AddFragment(new Fragments.StatsDiet(), "Diet");
  
              viewPager.Adapter = adapter;
          }
      }
  
  
  
      public class TabAdapter : FragmentPagerAdapter
      {
          public List&lt;SupportFragment&gt; Fragments { get; set; }
          public List&lt;string&gt; FragmentNames { get; set; }
  
          public TabAdapter(SupportFragmentManager sfm) : base(sfm)
          {
              Fragments = new List&lt;SupportFragment&gt;();
              FragmentNames = new List&lt;string&gt;();
          }
  
          public void AddFragment(SupportFragment fragment, string name)
          {
              Fragments.Add(fragment);
              FragmentNames.Add(name);
          }
  
          public override int Count
          {
              get
              {
                  return Fragments.Count;
              }
          }
  
          public override SupportFragment GetItem(int position)
          {
              return Fragments[position];
          }
  
          public override ICharSequence GetPageTitleFormatted(int position)
          {
              return new Java.Lang.String(FragmentNames[position]);
          }
      }
  }
  </code></pre>
  
  <p>And the code for the layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      android:background="#000000"&gt;
  &lt;!-- ScrollView Start --&gt;
      &lt;ScrollView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fitsSystemWindows="true"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;
          &lt;LinearLayout
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:fitsSystemWindows="true"&gt;
              &lt;LinearLayout
                  android:orientation="vertical"
                  android:minWidth="25px"
                  android:minHeight="25px"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:id="@+id/linearLayout1"
                  android:layout_marginTop="20dp"
                  android:paddingLeft="20dp"
                  android:paddingRight="20dp"&gt;
                  &lt;View
                      android:layout_width="match_parent"
                      android:layout_height="100dp"
                      android:id="@+id/view1"
                      android:background="@drawable/stats" /&gt;
                  &lt;android.support.design.widget.TabLayout
                      android:minWidth="25px"
                      android:minHeight="25px"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:id="@+id/tabs"
                      android:background="#ffffff" /&gt;
                  &lt;android.support.v4.view.ViewPager
                      android:id="@+id/viewpager"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      app:layout_behavior="@string/appbar_scrolling_view_behavior" /&gt;
              &lt;/LinearLayout&gt;
          &lt;/LinearLayout&gt;
      &lt;/ScrollView&gt;
  &lt;!-- ScrollView End --&gt;
  &lt;/LinearLayout&gt;
  </code></pre>