android - SmartTabLayout 厚度

标签 android android-activity tabbed-view

我正在使用 SmartTabLayout。我想使用这样的指标(如圆圈)。我在 xml 中找不到合适的参数。 有什么想法吗?

想要这个:

enter image description here

我有这个:

enter image description here

XML代码:

 <com.ogaclejapan.smarttablayout.SmartTabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        app:stl_clickable="true"
        app:stl_defaultTabBackground="?attr/selectableItemBackground"
        app:stl_defaultTabTextAllCaps="true"
        app:stl_defaultTabTextColor="#FC000000"
        app:stl_defaultTabTextHorizontalPadding="16dp"
        app:stl_defaultTabTextMinWidth="0dp"
        app:stl_defaultTabTextSize="12sp"
        app:stl_distributeEvenly="false"
        app:stl_dividerColor="#4D000000"
        app:stl_dividerThickness="1dp"
        app:stl_drawDecorationAfterTab="false"
        app:stl_indicatorAlwaysInCenter="false"
        app:stl_indicatorColor="#40C4FF"
        app:stl_indicatorCornerRadius="2dp"
        app:stl_indicatorGravity="bottom"
        app:stl_indicatorInFront="false"
        app:stl_indicatorInterpolation="smart"
        app:stl_indicatorThickness="4dp"
        app:stl_indicatorWidth="auto"
        app:stl_indicatorWithoutPadding="false"
        app:stl_overlineColor="#4D000000"
        app:stl_overlineThickness="0dp"
        app:stl_titleOffset="24dp"
        app:stl_underlineColor="#4D000000"
        app:stl_underlineThickness="1dp" />

最佳答案

浏览演示中的一些代码。我遇到了“技巧 1”布局,这可能就是答案。测试一下,如果它不起作用,请返回给我。如果不行,我会把项目拉出来测试一下。

<com.ogaclejapan.smarttablayout.SmartTabLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@id/viewpagertab"
    android:layout_width="match_parent"
    android:layout_height="@dimen/tab_height"
    android:clipToPadding="false"
    android:paddingLeft="4dp"
    android:paddingRight="4dp"
    app:stl_defaultTabTextColor="@color/white"
    app:stl_defaultTabTextHorizontalPadding="18dp"
    app:stl_dividerColor="@color/transparent"
    app:stl_dividerThickness="0dp"
    app:stl_indicatorColor="@color/black_20"
    app:stl_indicatorCornerRadius="18dp"
    app:stl_indicatorInterpolation="smart"
    app:stl_indicatorGravity="center"
    app:stl_indicatorThickness="36dp"
    app:stl_underlineColor="@color/transparent"
    app:stl_underlineThickness="0dp"
    />

关于android - SmartTabLayout 厚度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34694028/

相关文章:

android - RoboGuice 和 ActionbarSherlock 似乎不能一起工作

android - 如何在 android 的 youtube 播放器中隐藏 youtube Logo

android - Dagger 注入(inject)父类(super class)和子类

android - 我们可以在暂停之前在 startActivity() 之后执行代码吗?

java - 为什么 toMillis() 函数在 Java 中返回 -1

android - Intent 在ActivityResult 上返回空值

android - ACTION_SEND 用于发送短信

java - 获取选项卡式 Activity 的当前选定选项卡

android - 有没有一种声明式的方法可以在 Android 上创建选项卡式布局?