简体   繁体   English

如何解决这个错误? 我无法运行它,所以我不知道吗?

[英]how to resolve this errors ? i can not run it so i dont know?

i want to resolve my mistake pls help me 我想解决我的错误,请帮助我

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@Color/ColorPrimary</item>

        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@Color/ColorAccent</item>

    </style>         

android say: Error:(9, 34) No resource found that matches the given name (at 'colorAccent' with value '@Color/ColorAccent'). 机器人说:错误:(9,34)找不到与给定名称匹配的资源(在'colorAccent'处,值为'@ Color / ColorAccent')。

检查colors.xml中名称id的位置以及大小写和拼写是否正确,如您在样式文件中提到的那样。

Xml cannot allow capitalization. Xml不允许大写。 So the file name should be color and not Color Be careful with cases. 因此,文件名应为color而不是Color 。注意大小写。 Attributes are like variables, start with small letters. 属性就像变量,以小写字母开头。

Show us your colors.xml 向我们展示你的colors.xml

<resources>

    <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/ColorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/ColorAccent</item>
    </style>
<style name="Button_style" parent="@android:style/Widget.Button">
    <item name="android:textSize">25sp</item>
        <item name="android:background">#ffffad2f</item>
        <item name="android:textColor">#fff</item>
        <item name="android:textStyle">bold</item>
    </style>
</resources>

ok,i did so what is the problem again ? 好的,我这样做又是什么问题?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM