0

I need to create a custom tab layout, but I want the text to mimic the style used in the normal TabLayout.TabView.

To do that, I've set my text appearance to TextAppearance.Design.Tab.

If you take a look at TabLayout itself, you can see that's what TabView's text uses:

mTabTextAppearance = a.getResourceId(R.styleable.TabLayout_tabTextAppearance, R.style.TextAppearance_Design_Tab);

...

TextViewCompat.setTextAppearance(mTextView, mTabTextAppearance);

However, when my tabs display, I can clearly see the text is not the same. It's very similar, but the default tab looks to be more bold.

What am I doing incorrectly?

Sachin Rajput
  • 4,326
  • 2
  • 18
  • 29
Andrew
  • 20,756
  • 32
  • 99
  • 177

1 Answers1

0

The answer was to set the text appearance programmatically. Setting android:textAppearance on the TextView in the XML file doesn't seem to do anything. Setting the text appearance programmatically (like TabLayout.TabView) works.

Andrew
  • 20,756
  • 32
  • 99
  • 177