我增加了android:textAllCaps=“假”,但所有的字母仍然是大写的,为什么?

国际体育365 📅 2025-09-30 12:51:38 👤 admin 👁️ 9229 ❤️ 631
我增加了android:textAllCaps=“假”,但所有的字母仍然是大写的,为什么?

下面的代码是由AndroidStudio3.2.1选项卡活动向导创建的,所有选项卡文本都是大写的。

我希望只有第一个字母是选项卡文本的大写字母,所以我在布局xml文件中添加了android:textAllCaps="false“。

但是我发现所有的选项卡文本仍然是大写的,我如何修复它呢?

代码语言:javascript运行复制

xmlns:tools="http://schemas.android.com/tools"

xmlns:app="http://schemas.android.com/apk/res-auto"

android:id="@+id/main_content"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:fitsSystemWindows="true"

tools:context=".MainActivity">

android:id="@+id/appbar"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:paddingTop="@dimen/appbar_padding_top"

android:theme="@style/AppTheme.AppBarOverlay">

android:id="@+id/toolbar"

app:title="@string/app_name"

android:layout_width="match_parent"

android:layout_height="?attr/actionBarSize"

android:layout_weight="1"

android:background="?attr/colorPrimary"

app:popupTheme="@style/AppTheme.PopupOverlay"

app:layout_scrollFlags="scroll|enterAlways">

android:id="@+id/tabs"

android:textAllCaps="false"

android:layout_width="match_parent"

android:layout_height="wrap_content">

android:id="@+id/tabItem"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:textAllCaps="false"

android:text="@string/tab_text_1"/>

android:id="@+id/tabItem2"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="@string/tab_text_2"/>

android:id="@+id/tabItem3"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="@string/tab_text_3"/>

android:id="@+id/container"

android:layout_width="match_parent"

android:layout_height="match_parent"

app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

android:id="@+id/fab"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="end|bottom"

android:layout_margin="@dimen/fab_margin"

app:srcCompat="@android:drawable/ic_dialog_email"/>

风格

代码语言:javascript运行复制