Android 使用appcompat V21主题覆盖按钮样式

Android 使用appcompat V21主题覆盖按钮样式,android,android-layout,Android,Android Layout,我现在使用的是AppCompat.Theme,但我希望这些按钮不会像在v21设备上运行时那样显示标题全部大写。在V18或19上运行时,标题以混合大小写显示,正如我的字符串定义中所定义的那样,但在5.0上,它们都是大写的 一般来说,我可以通过使用没有任何特定继承的样式来设置按钮的样式,例如使用自定义背景图像。例如,以下是我的应用程序的主题定义: <style name="GedStarThemeMisc" parent="Theme.AppCompat"> <

我现在使用的是AppCompat.Theme,但我希望这些按钮不会像在v21设备上运行时那样显示标题全部大写。在V18或19上运行时,标题以混合大小写显示,正如我的字符串定义中所定义的那样,但在5.0上,它们都是大写的

一般来说,我可以通过使用没有任何特定继承的样式来设置按钮的样式,例如使用自定义背景图像。例如,以下是我的应用程序的主题定义:

    <style name="GedStarThemeMisc" parent="Theme.AppCompat">
      <item name="colorPrimary">@color/theme_other_primary</item>
      <item name="colorPrimaryDark">@color/theme_other_primary_dark</item>
      <item name="colorAccent">@color/theme_other_accent</item>
    </style>

@颜色/主题\u其他\u主要
@颜色/主题\u其他\u主要\u深色
@颜色/主题\u其他\u口音
下面是我应用于布局中按钮小部件的典型样式:

    <style name="large_cust_btn">
    <item name="android:layout_height">wrap_content</item>
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_marginTop">2dp</item>
    <item name="android:layout_marginBottom">2dp</item>
    <item name="android:layout_marginLeft">4dp</item>
    <item name="android:layout_marginRight">4dp</item>
    <item name="android:minHeight">10dp</item>
    <item name="android:paddingBottom">6dp</item>
    <item name="android:paddingTop">6dp</item>
    <item name="android:paddingLeft">4dp</item>
    <item name="android:paddingRight">4dp</item>
    <item name="android:textSize">15sp</item>
    <item name="android:capitalize">words</item>
</style>

包装内容
包装内容
2dp
2dp
4dp
4dp
10dp
6dp
6dp
4dp
4dp
15便士
话
“Capitalize”项是我试图覆盖明显的v21默认值。那么,我应该如何让我的特定按钮样式发挥作用呢?

尝试使用

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

用你的按钮风格。

你的问题很详细。但是自从我出来以后,已经被问了很多次了。所有按钮的大写字母都是L默认值。我现在看到了。我搜索过,但显然我的搜索词不够有创意。如果您支持API 10,则不起作用。应该在API22中修复,使用
false
,不带android前缀。谢天谢地,我们很快就要删除API 10了!