10

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.

Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142
Tosin Onikute
  • 3,883
  • 6
  • 38
  • 61
  • have you tried this [http://stackoverflow.com/a/31471430/4217346](http://stackoverflow.com/a/31471430/4217346) – Furqan Oct 16 '15 at 07:24
  • Any solution to this? I even tried setting tabIndicatorHeight to 25dp in the Theme and it won't update. Seems like the TabLayout won't even respect the assigned Theme. – pnavk Oct 26 '15 at 23:01
  • No, i ended up using SlidingtabLayout which also has its own issues too. – Tosin Onikute Oct 27 '15 at 02:09

4 Answers4

11

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"
Tara
  • 2,598
  • 1
  • 21
  • 30
4
  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"
W. Liz
  • 41
  • 2
0

This issue was reported on google https://code.google.com/p/android/issues/detail?id=202117

where the app:textAllCaps = "false" style did not work.

But after release of Android Support Library, revision 23.2.1 (March 2016) This issue has been resolved.

update Support Library to Android Support Library to 23.2.1

https://developer.android.com/topic/libraries/support-library/revisions.html

Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142
-1

Have you tried this The createDefaultTabView() method.

Needed to change textView.setAllCaps(true) to false.

Sliding tab layout text is uppercase

Community
  • 1
  • 1
reidisaki
  • 1,525
  • 16
  • 29