angcyo / DslTabLayout

:hearts: Android界最万能的TabLayout(不仅仅是TabLayout), 支持任意类型的item, 支持Drawable类型的指示器,智能开启滚动,支持横竖向布局等
https://github.com/angcyo/DslAdapter
MIT License
1.55k stars 145 forks source link

自动着色无效 #14

Closed MisoraRin closed 4 years ago

MisoraRin commented 4 years ago

这几个属性对imageview不生效,只对文字有效,指示器也没有显示 这是我的xml <com.angcyo.tablayout.DslTabLayout android:id="@+id/dslTabLayout" android:layout_width="match_parent" android:layout_height="48dp" app:layout_constraintBottom_toBottomOf="parent" app:tab_draw_indicator="true" app:tab_indicator_color="@color/colorPrimary" app:tab_item_is_equ_width="true" app:tab_select_color="@color/colorPrimary" app:tab_deselect_color="#626262">

angcyo commented 4 years ago

tab_indicator_color属性是给tab_indicator_drawable属性指定的Drawable着色.

如果要设置纯色指示器,请使用tab_indicator_solid_color. 纯色渐变指示器tab_indicator_gradient_start_color tab_indicator_gradient_end_color.

默认tab_select_color tab_deselect_color 只处理TextView, 如果要支持ImageView 请调用com.angcyo.tablayout.DslTabLayout#configTabLayoutConfig方法, 重写onGetIcoStyleView属性, 返回想要变色的ImageView即可.