android Button、TabLayout英文自动改小写为大写的问题

  如果是Button自动大写问题,直接设置Button的 textAllCaps="false" 即可;

  如果是TabLayout出现全大写问题,先在style.xml加入属性:

<style name="TabLayoutTextStyle" parent="TextAppearance.Design.Tab">
        <item name="android:textSize">12sp</item>
        <item name="textAllCaps">false</item>
</style>

布局中引入该样式即可

<!-- 注:无效方式 style="@style/TabLayoutTextStyle" -->
<android.support.design.widget.TabLayout
    android:id="@+id/pcTabLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:tabTextAppearance="@style/TabLayoutTextStyle" />

猜你喜欢

转载自www.cnblogs.com/jooy/p/9064005.html