【问题标题】:why are my colorPrimory and .. in theme.xml not color ? i am a begginer when I open color.xml there are purple and purple dark in my color.xml为什么我在 theme.xml 中的 colorPrimary 和 .. 不是 color ?我是初学者,当我打开 color.xml 时,我的 color.xml 中有紫色和深紫色
【发布时间】:2021-12-29 16:17:27
【问题描述】:

为什么我在 theme.xml 中的 colorPrimory 和 .. 不是 color ?当我打开 color.xml 时,我是初学者

【问题讨论】:

  • 需要编写您尝试过的代码和崩溃的错误日志

标签: android xml android-studio


【解决方案1】:

如果我没看错,你应该先在colors.xml中声明你的颜色,然后将它导入到themes.xml中,像这样:

在colors.xml中:

<color name="custom_red"> #9F0F17 </color>

在themes.xml中,在样式标签内

<item name="colorPrimary">@color/custom_red</item>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-12-14
    • 2012-08-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-28
    相关资源
    最近更新 更多