2

我使用PagerSlidingTabStrip它在縱向模式下工作正常,但是當我將其更改爲橫向模式時,它們的標籤不覆蓋所有屏幕的房地產並保持左對齊。PagerSlidingTabStrip橫向模式填充修補

如何使它們均勻間隔?

How to fix it?

回答

5

剛去圖書館類即PagerSlidingTabStrip和改變這一行

private boolean shouldExpand = false; 

private boolean shouldExpand = true; 

希望這有助於!

0

嘗試設置你的PagerSlidingTabStrip作爲match_parent的寬度。 :)

<com.example.PagerSlidingTabStrip 
    android:id="@+id/tabs" 
    **android:layout_width="match_parent"** 
    android:layout_height="48dip" 
    android:background="@drawable/background_tabs" /> 
+0

它是水平滾動視圖,所以它沒有任何區別 –

1
<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