在我的应用“Tide Now WA”中,我最近测试了它的兼容性 新款Nexus 9平板电脑(Lollipop - API 21)。

它写一些按钮文本。这个应用程序使用Android 2.3和Android正确地编写文本 4.0. 即混合大写字母和小写字母。

当同一个应用程序在我的Nexus 9上运行时,所有的字母 正文均大写。

FWIW我的清单包含以下语句:

users -sdk android:minSdkVersion="10" android:targetSdkVersion="14"

我可以在我的代码中修复这个问题,还是操作系统中的一个bug 谢谢


当前回答

这在应用程序代码中是可以通过设置按钮的TransformationMethod来修复的。

mButton.setTransformationMethod(null);

其他回答

如果你已经到达这里,因为你的facebook按钮文本出现在所有的大写,然后只需添加这个android:textAllCaps="false"在你的xml文件。这对我很管用。

这在应用程序代码中是可以通过设置按钮的TransformationMethod来修复的。

mButton.setTransformationMethod(null);

使用这行android:textAllCaps="false"在你的xml

<Button
            android:id="@+id/btn_login"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/login_str"
            android:background="@color/colorBlue"
            android:textColor="@color/colorWhite"
            android:textAllCaps="false"
           />

默认情况下,按钮在android提供所有大写关键字。如果你想按钮文本是小写或混合大小写,你可以禁用textAllCaps标志使用android:textAllCaps="false"

按样式添加这一行

    <item name="android:textAllCaps">false</item>