自定义颜色不带Android.theme.material显示



在我的values-v21文件夹中,我有以下样式。xml,我在其中自定义theme.material:

<resources>
    <style name="AppTheme" parent="android:Theme.Material">
        <item name="colorPrimary">#880E4F</item>
        <item name="colorPrimaryDark">#E91E63</item>
        <item name="colorAccent">#FCE4EC</item>
    </style>
</resources>

但是,当我在Android API上运行应用时,我看不到任何这些颜色。我确实在Android清单中称为主题:android:theme="@style/AppTheme"。我尝试使用我的标准值文件夹(=> api 21或更小,我也有同样的问题)。

在文件夹values-v23中添加

<resources>
<style name="AppTheme" parent="android:Theme.Material">
    <item name="android:colorPrimary">#880E4F</item>
    <item name="android:colorPrimaryDark">#E91E63</item>
    <item name="android:colorAccent">#FCE4EC</item>
</style>
</resources>

我希望有效!

最新更新