Is there a way to set a particular Tablayout.Tab text color programmatically, without using a state list?
问题 The question is how to change a single TabLayout.Tab's text color. Ideally, I'd like to iterate over the tabs and change their color based on information contained on the fragment of a corresponding ViewPager. 回答1: The easiest way is to get the TextView from a specified TabLayout.Tab and then set the text color using TextView.SetTextColor(Color color) , which you can do as followed: TabLayout tabLayout = new TabLayout(this); int wantedTabIndex = 0; TextView tabTextView = (TextView)((