Android Tablayout Set textAllCaps to False not working
Asked Answered
S

4

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.

Suture answered 23/9, 2015 at 17:3 Comment(3)
have you tried this https://mcmap.net/q/173166/-text-size-of-android-design-tablayout-tabsPeruzzi
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.Panter
No, i ended up using SlidingtabLayout which also has its own issues too.Suture
D
12

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"
Dishonorable answered 20/7, 2016 at 9:57 Comment(0)
D
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"
Dicotyledon answered 11/10, 2016 at 7:29 Comment(0)
S
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

Selfassertion answered 15/3, 2016 at 7:2 Comment(0)
P
-1

Have you tried this The createDefaultTabView() method.

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

Sliding tab layout text is uppercase

Pontias answered 23/9, 2015 at 17:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.