代码之家  ›  专栏  ›  技术社区  ›  Bhuvanesh BS

无法解析符号“”?selectableItemBackgroundBorderless'

  •  2
  • Bhuvanesh BS  · 技术社区  · 6 年前

    我面临一个奇怪的问题。当我使用以下完美工作的属性时,我可以看到设备中的涟漪效应。

    android:foreground="?selectableItemBackgroundBorderless"
    
    android:background="?selectableItemBackgroundBorderless"
    

    但在 IDE 显示无法解析符号的错误 '?selectableItemBackgroundBorderless'

    Android Studio:v3。1.2

    compileSdkVersion 27
    buildToolsVersion "27.0.3"
    
    support_version = '27.1.1'
    

    可能是什么问题?

    2 回复  |  直到 6 年前
        1
  •  3
  •   AskNilesh    6 年前

    我也遇到过同样的问题 27.0.3

    具有 27.0.3 版本

    enter image description here

    具有 27.0.2 版本

    enter image description here

    使用 27.0.2 而不是 27.0.3

    Clean-ReBuild-Run 您的项目

    编辑

    如果要使用 27.0.3 然后按照这个答案 https://stackoverflow.com/a/48734990/7666442

        2
  •  0
  •   Yash Parikh    6 年前

    从API版本级别21起,使用:

    android:foreground="?android:attr/selectableItemBackgroundBorderless"
    android:background="?android:attr/selectableItemBackgroundBorderless"