Reputation: 45
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
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
Reputation: 534
For changing colour of indicator programmatically.
tabLayout.setSelectedTabIndicatorColor(Color.parseColor("#898989"));
Upvotes: 4
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