首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Android无法解析符号“?attr/selectableItemBackground”

Android无法解析符号“?attr/selectableItemBackground”
EN

Stack Overflow用户
提问于 2017-05-17 01:10:05
回答 4查看 17.9K关注 0票数 54
代码语言:javascript
复制
<android.support.v7.widget.CardView
    android:id="@+id/card_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="@dimen/card_outer_padding"
    android:layout_marginTop="@dimen/card_outer_padding"
    android:layout_marginRight="@dimen/card_outer_padding"
    android:layout_marginBottom='@{model.cardBottomMargin}'
    android:foreground="?attr/selectableItemBackground"
    android:onClick="@{model::onCardClick}"
    app:cardElevation="2dp"
    app:cardCornerRadius="2dp"
    app:cardUseCompatPadding="true">
</android.support.v7.widget.CardView>

我收到了这个错误消息

无法解析symbol ?attr/selectableItemBackground验证Android XML文件中的资源引用。

代码语言:javascript
复制
<TextView
    android:id="@+id/country_name"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginRight="40dp"
    android:text="@{model.name}"
    style="@style/TextAppearance.AppCompat.Headline"
    tools:text="Country"/>

而且,我在上面也得到了一个类似的错误

无法解析符号“@style/TextAppearance.AppCompat.Headline”

验证Android XML文件中的资源引用。

任何指针都可以!谢谢!它似乎与此thread有关,但没有提供任何解决方案:

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44007653

复制
相关文章

相似问题

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