I have been trying to explore online to set my font size for TabLayout TabItems But none of them seems to be working for me. This is what I tried referring last link
below are the things which I have implemented so far,
Not sure why it's not picking textSize
from style.
in xml:
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayoutForgot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/header_height"
app:layout_constraintTop_toBottomOf="@+id/imageViewLogo"
app:tabIndicatorColor="@color/text_color"
app:tabSelectedTextColor="@color/text_color"
app:tabGravity="fill"
app:tabTextAppearance="@style/MyCustomTabLayout"
app:tabMode="fixed"
app:tabIndicatorFullWidth="false"
app:tabTextColor="@color/text_color" />
in themes.xml:
<style name="MyCustomTabLayout" parent="@android:style/TextAppearance.Widget.TabWidget">
<item name="textAllCaps">false</item>
<item name="android:textSize">20sp</item>
<item name="android:fontFamily">@font/roboto_medium</item>
<item name="android:textColor">@color/text_color</item>
</style>
this does everything else like textAllCaps
and fontFamily
but doesn't seems to take textSize
.
Appreciate any help.