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

TAB选中项加粗状态有缺陷 #541

Open
liyujiang-gzu opened this issue Jan 17, 2022 · 3 comments
Open

TAB选中项加粗状态有缺陷 #541

liyujiang-gzu opened this issue Jan 17, 2022 · 3 comments

Comments

@liyujiang-gzu
Copy link

updateTabStyles()里需要加上mTextBold == TEXT_BOLD_WHEN_SELECT的情况,不然初始化后默认选中项不会加粗:

                if (mTextBold == TEXT_BOLD_BOTH) {
                    tv_tab_title.getPaint().setFakeBoldText(true);
                } else if (mTextBold == TEXT_BOLD_NONE) {
                    tv_tab_title.getPaint().setFakeBoldText(false);
                }
liyujiang-gzu added a commit to liyujiang-gzu/FlycoTabLayout that referenced this issue Jan 21, 2022
@liyujiang-gzu
Copy link
Author

app:tl_textBold="SELECT"的情况下,默认选中的第一项未加粗:

    <com.flyco.tablayout.SlidingTabLayout
        android:id="@+id/department_main_tab"
        android:layout_width="match_parent"
        android:layout_height="@dimen/dp_42"
        app:tl_indicator_color="#FB9B97"
        app:tl_indicator_corner_radius="@dimen/dp_3"
        app:tl_indicator_gravity="BOTTOM"
        app:tl_indicator_height="@dimen/dp_3"
        app:tl_indicator_margin_bottom="@dimen/dp_5"
        app:tl_indicator_width="@dimen/dp_20"
        app:tl_indicator_width_equal_title="true"
        app:tl_tab_padding="@dimen/dp_20"
        app:tl_textBold="SELECT"
        app:tl_textSelectColor="#262525"
        app:tl_textSelectSize="@dimen/sp_14"
        app:tl_textUnselectColor="#999594"
        app:tl_textsize="@dimen/sp_14" />

@liyujiang-gzu
Copy link
Author

liyujiang-gzu commented Jan 21, 2022

临时修复效果:implementation 'com.github.liyujiang-gzu:FlycoTabLayout:781b8829a7'

@liyujiang-gzu liyujiang-gzu mentioned this issue Jan 21, 2022
liyujiang-gzu added a commit to liyujiang-gzu/FlycoTabLayout that referenced this issue Jan 21, 2022
@liyujiang-gzu
Copy link
Author

@H07000223 PR #543

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