Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

最新的TabLayout定制指示器宽度和颜色的实现. #9

Open
github-huangxin opened this issue Jun 18, 2022 · 0 comments
Open

Comments

@github-huangxin
Copy link

<com.google.android.material.tabs.TabLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:tabIndicator="@drawable/shape_tab_layout_indicator"
    app:tabIndicatorColor="@color/colorPrimary" />
  • ##shape_tab_layout_indicator 实现
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:gravity="center">
        <shape>
            <solid android:color="@color/colorPrimary" />
            <size
                android:width="@dimen/dp_18"
                android:height="@dimen/dp_3" />
            <corners android:radius="@dimen/dp_3" />
        </shape>
    </item>
</layer-list>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant