我在ViewPager中使用庫PagerSlidingTabStrip動態數量的標題。這是一個很棒的圖書館,易於使用,但我需要更多地定製它。PagerSlidingTabStrip選定的選項卡行頂部
我的PagerSlidingTabStrip標題位於屏幕的底部,因此,我需要在PagerSlidingTabStrip組件的頂部顯示'全寬下劃線'和'選中的項目行指示符'。
一些測試後,我在正確的位置,終於在「全寬下劃線」,使用附配的LinearLayout是這樣的:
<LinearLayout
android:id="@+id/tabs_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_alignParentBottom="true">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="2dp"
android:orientation="vertical"
android:background="@color/lfp_yellow"/>
<com.astuetz.PagerSlidingTabStrip
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="48dip"
app:pstsDividerColor="@android:color/transparent"
app:pstsIndicatorColor="@color/light_yellow"
app:pstsIndicatorHeight="4px"
app:pstsShouldExpand="true"/>
</LinearLayout>
但我還沒有形成的地方「所選項目線指示」處最佳。我試圖改變所選項目的背景,與頂部的線繪製,但不工作:(
任何想法?
非常感謝。