gpt4 book ai didi

android - 使用 Android 设计支持库时出错 : attr backgroundTint not found

转载 作者:IT老高 更新时间:2023-10-28 23:37:47 27 4
gpt4 key购买 nike

尝试在我的项目中使用新的设计支持库,AAPT 抛出以下错误:

Description: Error: No resource found that matches the given name: attr 'backgroundTint'.
Resource: /design/res/values/styles.xml
Location: line 21

这是 styles.xml 中受影响的条目:

<style name="Widget.Design.FloatingActionButton" parent="android:Widget">
<item name="android:background">@drawable/fab_background</item>
<item name="backgroundTint">?attr/colorAccent</item>
<item name="fabSize">normal</item>
<item name="elevation">@dimen/fab_elevation</item>
<item name="pressedTranslationZ">@dimen/fab_translation_z_pressed</item>
<item name="rippleColor">?attr/colorControlHighlight</item>
<item name="borderWidth">@dimen/fab_border_width</item>
</style>

我的项目目标是使用 SDK 21,最小 SDK 设置为 17。

编辑:我的所有 SDK 工具都是最新的。

最佳答案

将 appcompat-v7 库添加为设计库项目的依赖项。它为我解决了同样的错误。我觉得对你有帮助。

关于android - 使用 Android 设计支持库时出错 : attr backgroundTint not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30602710/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com