尝试在我的项目中使用新的设计支持库,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/