Question

I am using PagerSlidingTabStrip it's working fine in portrait mode but when I change it to landscape mode then they tabs don't cover all the screen real estate and stays left aligned.

How to make them evenly spaced?

How to fix it?

Was it helpful?

Solution

Just go the library class i.e. PagerSlidingTabStrip and change this line

private boolean shouldExpand = false; 

to

private boolean shouldExpand = true;

Hope this helps.!

OTHER TIPS

<com.astuetz.PagerSlidingTabStrip
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="36dp"
        android:background="@drawable/background_tabs"
        android:fillViewport="false"
        viewpager_:pstsIndicatorHeight="3dp"
        viewpager_:pstsShouldExpand="true" /> <---just make it true

Try setting the width of your PagerSlidingTabStrip as match_parent. :)

<com.example.PagerSlidingTabStrip
    android:id="@+id/tabs"
    **android:layout_width="match_parent"**
    android:layout_height="48dip"
    android:background="@drawable/background_tabs" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top