public static void setTextViewsCapsOff(View view) { if (!(view instanceof ViewGroup)) { return; } ViewGroup group = (ViewGroup)view; for (int i = 0; i < group.getChildCount(); i++) { View child = group.getChildAt(i); if (child instanceof TextView) { ((TextView)child).setAllCaps(false); } else { setTextViewsCapsOff(child); } } }
Go to your TabLayout to this recursive method. It will find any child TextView object and disable its All Caps mode. Avoids all other very specific types. If it does not work, refer to it later in your code. I had this in onCreate, but it did not work. Called later in the code, and it works great.
Affects all tabs, not just one, but I think this is the most common use. Not specific to TabLayout. Can be used for any layout containing TextViews that you want to change.
Kevin source share