astuetz / PagerSlidingTabStrip

An interactive indicator to navigate between the different pages of a ViewPager
139 stars 44 forks source link

How to automatically expand the width of the tab? #307

Open Hudhud opened 7 years ago

Hudhud commented 7 years ago

Hello

How do I let the tabs get expanded if the string in the tab is too long? This is how it looks like now: 18678987_10154327212666199_1691877758_n

If the string is too long, some of it doesn't appear. The weird thing is that it worked on Android 6.0, but now I am running on Android 7.0 (phone and emulator), and this happened. How to I fix it?

This is my XML code for the PagerSlidingTabStrip:

    <com.astuetz.PagerSlidingTabStrip
        android:id="@+id/tabs"
        app:pstsShouldExpand="true"
        app:pstsTextAllCaps="true"
        app:pstsIndicatorColor="#8b4513"
        android:layout_width="match_parent"
        android:background="#ffffff"
        android:layout_height="48dp" />
newstarbka commented 6 years ago

use pstsTabPaddingLeftRight attibute