gpt4 book ai didi

android - 有没有办法设置 PagerSlidingTabStrip 指示器宽度

转载 作者:行者123 更新时间:2023-11-29 02:41:38 28 4
gpt4 key购买 nike

这里我使用的是Android PagerSlidingTabStrip,我想知道如何设置它的indicator width not full of its tab,比如设置它的indicator width 2/3作为它的tab。

这是我的 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>

我已经设置了它的边距,但是边距设置只是改变了标签的水平位置,而设置 padding 对它的指示器没有影响。所以任何人都可以告诉我如何设置它的指示器宽度。谢谢。

最佳答案

@Crabime 有一定的属性pstsIndicatorHeight 滑动指示器的高度pstsUnderlineHeight View 底部全宽线的高度pstsDividerPadding 分隔符的顶部和底部填充pstsScrollOffset 所选选项卡的滚动偏移量pstsTabBackground 每个选项卡的背景可绘制对象,应该是一个 StateListDrawablepstsShouldExpand 如果设置为true,每个tab被赋予相同的权重,默认false引用链接:https://guides.codepath.com/android/sliding-tabs-with-pagerslidingtabstrip

关于android - 有没有办法设置 PagerSlidingTabStrip 指示器宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43671033/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com