Closed AndMy closed 4 years ago
可以了,我在textview外面嵌套了一层ConstraintLayout布局,item布局必须是textview?
可以了,我在textview外面嵌套了一层ConstraintLayout布局,item布局必须是textview?
不是必须的.
可以通过configTabLayoutConfig
指定TextView
控件的id. 属性名:tabTextViewId
代码动态添加单项:A、B、C。其中A、C是TextView。B是:LinearLayout->TextView+ImageView。请问改怎么改动呢?没看懂。 @angcyo
可以了,我在textview外面嵌套了一层ConstraintLayout布局,item布局必须是textview?
不是必须的.
可以通过
configTabLayoutConfig
指定TextView
控件的id. 属性名:tabTextViewId
可以实现onGetTextStyleView
回调:
如下:
configTabLayoutConfig {
onGetTextStyleView = { itemView, _ ->
itemView.find(R.id.lib_tab_text_view)
}
onGetIcoStyleView = { itemView, _ ->
itemView.find(R.id.lib_tab_image_view)
}
}
感谢及时回复。但是A、B、C我是代码动态添加的,没有id啊。
懂了。感谢。
app:tab_select_color="#F42834" app:tab_deselectcolor="@color/c6" 用下面的代码设置也是没效果的 onSelectIndexChange = { fromIndex, selectIndexList, reselect, -> val toIndex = selectIndexList.first() tabSelectColor = Color.parseColor("#F42834") tabDeselectColor = Color.parseColor("#666666") _viewPagerDelegate?.onSetCurrentItem(fromIndex, selectIndexList.last()) } 能帮我看一下什么问题?