Android原生TabLayout使用技巧
1,TabLayout 英文自动大写的问题。
在此记录下该问题解决办法。
1.碰到这种问题我们第一时间应该查看 Android 源码,在源码中会发现 TabLayout 的默认属性中 tabTextAppearance 继承了 Button 的 textAllCaps 属性.
TabLayout.java
tabTextAppearance =
a.getResourceId(R.styleable.TabLayout_tabTextAppearance, R.style.TextAppearance_Design_Tab);
styles.xml
<style name="TextAppearance.Design.Tab" parent="TextAppearance.AppCompat.Button">
<item name="android:textSize">@dimen/design_tab_text_size</item>
<item name="android:textColor">?android:textColorSecondary</item>
<item name="textAllCaps">true</item>
</style>
我们通过查