Search code examples
androidandroid-tablayout

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


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


Solution

  • 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"/>