【发布时间】:2017-04-28 02:33:26
【问题描述】:
这里我使用的是 Android PagerSlidingTabStrip,我想知道如何设置它的指示器宽度不填满它的选项卡,例如将它的指示器宽度设置为 2/3 作为它的选项卡。
这是我的 xml 配置:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/viewItemWhiteBg">
<include layout="@layout/default_header_actionbar" />
<com.astuetz.PagerSlidingTabStrip
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_height="40dp"
app:pstsShouldExpand="true"
app:pstsScrollOffset="20dp"
app:pstsTabPaddingLeftRight="20dp"/>
<android.support.v4.view.ViewPager
android:id="@+id/infoTypePager"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
我已经设置了它的边距,但是边距设置只是改变了选项卡的水平位置,并且设置的填充对其指示器没有影响。所以任何人都可以告诉我如何设置它的指示器宽度。谢谢。
【问题讨论】:
标签: android pagerslidingtabstrip