麦田

不积跬步无以至千里.

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

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" />
posted on 2025-06-11 14:21  一些记录  阅读(67)  评论(0)    收藏  举报