首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Android链接失败值,styles.xml

Android链接失败值,styles.xml
EN

Stack Overflow用户
提问于 2019-11-08 07:46:41
回答 1查看 2.9K关注 0票数 0

,所以我想要创建一个新的android项目,然后突然出现了这个错误,说Android失败了,下面是我的代码。

Styles.xml

代码语言:javascript
运行
复制
resources>

    <!-- Base application theme. -->
    <style type ="attr" name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item type="attr" name="colorPrimary">@color/colorPrimary</item>
        <item type="attr" name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item type="attr" name="colorAccent">@color/colorAccent</item>
    </style>

</resources>

错误显示为

代码语言:javascript
运行
复制
C:\Users\ASUS\Desktop\Rapih\Re_Mind\app\src\main\res\values\styles.xml:4:5-9:13: AAPT: error: style attribute 'attr/colorPrimary (aka app.com.re_mind:attr/colorPrimary)' not found.
EN

回答 1

Stack Overflow用户

发布于 2019-11-08 07:56:30

使用这样的东西,不要添加类型属性。这可能对你有帮助。

代码语言:javascript
运行
复制
 <style name="AppTheme" parent="Base.Theme.MaterialComponents.Light.DarkActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58762468

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档