I am putting a ViewPager
inside a Fragment
.
When I set a fixed height to the ViewPager like layout_height=300dp
, the ViewPager with its contents are visible.
But when I change the height of the Viewpager to either fill_parent
,match_parent
or wrap_content
the Viewpager
does not get dispalyed.
I am posting my layout below.Please help.
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3" >
<Button
android:id="@+id/btn_reviews"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/reviews" />
<Button
android:id="@+id/btn_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/Description" />
<Button
android:id="@+id/btn_specs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/Specs" />
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pagers"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000" >
</android.support.v4.view.ViewPager>
</LinearLayout>