Java appcompat原色实现
My styles.xml文件拒绝工作。我做错了什么?它表示预期的结束标记,需要属性值Java appcompat原色实现,java,android,Java,Android,My styles.xml文件拒绝工作。我做错了什么?它表示预期的结束标记,需要属性值 <!-- Base application theme. --> <style name="Theme.MainTheme" parent="Theme.AppCompat.Light"> <!-- colorPrimary is used for the default action bar background --> <item name=”co
<!-- Base application theme. -->
<style name="Theme.MainTheme" parent="Theme.AppCompat.Light">
<!-- colorPrimary is used for the default action bar background -->
<item name=”colorPrimary”>@colors/Primary</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name=”colorPrimaryDark”>@colors/PrimaryDark</item>
<!-- colorAccent is used as the default value for colorControlActivated, which is used to tint widgets -->
<item name=”colorAccent”>@colors/Accent</item>
</style>
@颜色/原色
@颜色/原色暗
@颜色/重音
colors.xml(存储在res\values中)
#03A9F4
#0288D1
#1DE9B6
你需要说@color而不是@colors。Colors是Colors.xml文件的名称,但是您正在查找颜色资源,可以使用@color访问这些资源
<item name="colorPrimary">@color/Primary</item>
@color/Primary
我做了这些更改,但没有解决问题
<item name="colorPrimary">@color/Primary</item>