How can I change the color of the underline of the selected tab on the new TabLayout?
The PagerTabStrip has a method setTabIndicatorColor(int color)
, Tab
you can use setcustomTebColorizer below is the example
mSlidingTabLayout=(SlidingTabLayout)findViewById(R.id.sliding_tabs);
mSlidingTabLayout.setCustomTabColorizer(new SlidingTabLayout.TabColorizer() {
@Override
public int getIndicatorColor(int position) {
return Color.YELLOW;
}
@Override
public int getDividerColor(int position) {
return 0;
}
});