How to set unselected Text Color for TabLayout.Tab - Android

Tim Nuwin picture Tim Nuwin · Dec 28, 2016 · Viewed 8.4k times · Source

How do you set text-color for a tab that's not selected? I know you can set the text-color for the TabLayout by doing: setTabTextColors

Answer

Saurabh Padwekar picture Saurabh Padwekar · Dec 28, 2016

Use app:tabTextColor for default tab color and app:tabSelectedTextColor for selected tab color.

        <android.support.design.widget.TabLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:tabTextColor="#000000"
            app:tabSelectedTextColor="#FFFFFF"/>