1

Here is my customized material viewpager layout

I have to change my material view pager tab indicator color and font programmatically. Please give me a solution for this.I cannot able to find any solution for this in github.

3 Answers3

4

For changing colour of indicator programmatically.

tabLayout.setSelectedTabIndicatorColor(Color.parseColor("#898989"));
Nouman Shah
  • 534
  • 1
  • 9
  • 22
1

Please use below attribute to change the color of the indicator in tabLayout:

 app:tabIndicatorColor="@android:color/white"

For custom font, refer following link: Change the font of tab text in android design support TabLayout

Community
  • 1
  • 1
Saritha G
  • 2,588
  • 1
  • 15
  • 27
1

To Change the color of the indicator in tabLayout:

 app:tabIndicatorColor="@android:color/your_color"

This is the line in my build.gradle:

compile 'com.android.support:design:23.1.1' //Make sure check your version
Venky
  • 21
  • 3