Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Tablayout Set textAllCaps to False not working

I am trying to make my ViewPager Tab text in small caps but its not working,

I have searched and checked other post related to this, tried their solution, but still doesn't work

<style name="MyCustomTabLayout" parent="Widget.Design.TabLayout">
      <item name="tabTextAppearance">@style/MyCustomTextAppearance</item>
</style>

<style name="MyCustomTextAppearance" parent="TextAppearance.Design.Tab">
      <item name="textAllCaps">false</item>
</style>

ViewPager Tab layout

<android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        app:textAllCaps="false"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/MyCustomTabLayout" />

Please any confirmed working solution to this?

thanks.

like image 634
Tosin Onikute Avatar asked Sep 23 '15 17:09

Tosin Onikute


2 Answers

Its bit late but hope it will help some one. If you are using support design then you just need to add below mentioned line in your tab layout and get the expected results.

app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
like image 58
Tara Avatar answered Sep 18 '22 09:09

Tara


  1. Try using both <item name="textAllCaps">false</item> <item name="android:textAllCaps">false</item> in your MyCustomTextAppearance
  2. In your ViewPager tab layout, replace android:theme="@style/MyCustomTabLayout"withstyle="@style/MyCustomTabLayout"
like image 35
W. Liz Avatar answered Sep 22 '22 09:09

W. Liz