How to change selected Tab Text color using TabLayout from code in Android?

后端 未结 8 940
悲哀的现实
悲哀的现实 2020-12-13 01:58

\"enter

I\'m using android.support.widget.TabLayout

8条回答
  •  没有蜡笔的小新
    2020-12-13 02:30

    It's so simple using XML. Just add the following 2 attributes in your tab layout.

    app:tabSelectedTextColor="@color/color_primary_text"
    app:tabTextColor="@color/color_secondary_text"
    

    So, your code would look something like this.

    
    

提交回复
热议问题