title: Is it possible to have a ViewPager inside of a ScrollView?
body: <p>I'm trying to use a <code>ViewPager</code> inside of a <code>ScrollView</code>, but the <code>ViewPager</code> does not appear. If I remove the <code>ScrollView</code> the <code>ViewPager</code> appears fine.</p>
  
  <p>I've created a simple test project with the following:</p>
  
  <p>main.xml layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical" android:layout_width="fill_parent"
  android:layout_height="fill_parent"&gt;
      &lt;ScrollView
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"&gt;
  
          &lt;android.support.v4.view.ViewPager
              android:layout_width="fill_parent" 
              android:layout_height="fill_parent"
              android:id="@+id/viewpager" /&gt;
  
      &lt;/ScrollView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Activity class:</p>
  
  <pre><code>public class ScrollViewWithViewPagerActivity extends Activity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          ViewPager vp = (ViewPager) findViewById(R.id.viewpager);
          vp.setAdapter(new MyPagerAdapter(this));
      }
  }
  
  class MyPagerAdapter extends PagerAdapter {
  
      private Context ctx;
  
      public MyPagerAdapter(Context context) {
          ctx = context;
      }
  
      @Override
      public int getCount() {
          return 2;
      }
  
      @Override
      public Object instantiateItem(View collection, int position) {
  
          TextView tv =  new TextView(ctx);
          tv.setTextSize(50);
          tv.setTextColor(Color.WHITE);
          tv.setText("SMILE DUDE, SMILE DUDE, SMILE DUDE, SMILE DUDE, SMILE DUDE, " +
                  "SMILE DUDE, SMILE DUDE, SMILE DUDE, SMILE DUDE, SMILE DUDE, " +
                  "SMILE DUDE, SMILE DUDE, SMILE DUDE, SMILE DUDE, SMILE DUDE, " +
                  "SMILE DUDE, SMILE DUDE, SMILE DUDE");
  
          ((ViewPager) collection).addView(tv);
  
          return tv;
  
      }
  
      @Override
      public void destroyItem(View collection, int position, Object view) {
           ((ViewPager) collection).removeView((View) view);
      }
  
      @Override
      public boolean isViewFromObject(View view, Object object) {
          return view == object;
      }
  
      @Override
      public Parcelable saveState() {
          return null;
      }
  
      @Override
      public void restoreState(Parcelable arg0, ClassLoader arg1) {
      }
  
      @Override
      public void startUpdate(View arg0) {
      }
  
      @Override
      public void finishUpdate(View arg0) {
      }
  }
  </code></pre>
  
  <p>Thanks for your time.</p>