Skip to content Skip to sidebar Skip to footer

Fix Viewpager Android Views

I have Android application with a tabbed viewpager see the image screenshot of the running app http://i.stack.imgur.com/zhlKF.png The problem is that i see blank pages instead my x

Solution 1:

from the activity_main you posted: you need a viewgroup outside of the viewpager, and you need to make the height of pagertabstrip wrap content.

the java code you posted looks correct to me.

Solution 2:

You have wrong activity_main layout, so try this:

<?xml version="1.0" encoding="utf-8"?><android.support.v4.view.ViewPagerxmlns:android="schemas.android.com/apk/res/android"android:id="@+id/pager"android:layout_width="match_parent"android:layout_height="match_parent"><android.support.v4.view.PagerTabStripandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_gravity="top"
      /></android.support.v4.view.ViewPager>

main mistake in your original is: android:layout_height="match_parent"

Post a Comment for "Fix Viewpager Android Views"