FlycoTabLayout icon indicating copy to clipboard operation
FlycoTabLayout copied to clipboard

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

Open yongchao1210 opened this issue 3 years ago • 4 comments

**app:tl_textBold="SELECT"**的情况下,默认选中的第一项未加粗,这个问题是没麻烦作者修复一下。 <com.flyco.tablayout.SlidingTabLayout android:id="@+id/stl_tab" android:layout_width="match_parent" android:layout_height="40dp" app:tl_divider_color="@color/transparent" app:tl_divider_padding="13dp" app:tl_divider_width="1dp" app:tl_indicator_color="@color/common_primary_color" app:tl_indicator_height="2dp" app:tl_indicator_width_equal_title="true" app:tl_tab_padding="15dp" app:tl_tab_space_equal="true" app:tl_textBold="SELECT" app:tl_textSelectColor="@color/common_text_title_color" app:tl_textUnselectColor="@color/common_text_explain_color" app:tl_textsize="15sp" app:tl_underline_color="@color/transparent" app:tl_underline_height="0dp" />

yongchao1210 avatar Jan 24 '22 06:01 yongchao1210

自己改吧,老BUG了,好多年了

liyuhaolol avatar Apr 27 '22 02:04 liyuhaolol

怎么改这个

lovemelon2017 avatar Aug 05 '22 10:08 lovemelon2017

updateTabStyles()这个方法处 要将TEXT_BOLD_WHEN_SELECT 这里添加上 if (mTextBold == TEXT_BOLD_BOTH) { tv_tab_title.getPaint().setFakeBoldText(true); } else if (mTextBold == TEXT_BOLD_WHEN_SELECT) { if (i == 0) { tv_tab_title.getPaint().setFakeBoldText(true); } } else if (mTextBold == TEXT_BOLD_NONE) { tv_tab_title.getPaint().setFakeBoldText(false); }

xiongsongyu2016 avatar Aug 10 '22 09:08 xiongsongyu2016

还有一个临时解决办法就是先设置一个其他的,再设置第一个,这样也可以 mSlideTabLayout.setCurrentTab(1); mSlideTabLayout.setCurrentTab(0);

FrankLove avatar Apr 11 '23 11:04 FrankLove