How to change material viewpager tab indicator text color?

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.

Upvotes: 1

Views: 4785

Answers (3)

Venky
Venky

Reputation: 21

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

Upvotes: 1

Nouman Shah
Nouman Shah

Reputation: 534

For changing colour of indicator programmatically.

tabLayout.setSelectedTabIndicatorColor(Color.parseColor("#898989"));

Upvotes: 4

Saritha G
Saritha G

Reputation: 2608

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

Upvotes: 1

Related Questions