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
Try to download below file from this location :
https://github.com/google/iosched/tree/master/android/src/main/java/com/google/samples/apps/iosched/ui/widget
SlidingTabLayout.java
SlidingTabStrip.java
Try to set tab indicator color this way :
slidingTabLayout.setCustomTabColorizer(new SlidingTabLayout.TabColorizer() {
@Override
public int getIndicatorColor(int position) {
return getResources().getColor(R.color.color_name);
}
});