How to set text on tab bar in lowercase letters?… here is a solution to the problem.
How to set text on tab bar in lowercase letters?
I wrote the video, but in the tabs it appears in capital letters. I want it to be like “video”
TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
tabLayout.addTab(tabLayout.newTab().setText("Videos"));
tabLayout.addTab(tabLayout.newTab().setText("Notes"));
Solution
Well, if I’m not misunderstood you have to create a styles.xml
as follows:
<style name="CustomTabs" parent="TextAppearance.Design.Tab">
<item name="android:textSize">YOUR_TEXT_SIZE</item>
<item name="android:textAllCaps">false</item>
</style>
Then add : in the layout
where the TabLayout
is placed
app:tabTextAppearance="@style/CustomTabs"
If you don’t want to display headings without capital letters, you also have to add this on your style
:
<item name="android:textAllCaps">false</item>
Solution
The best way to do this is to add it to your TabLayout
xml
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"