【问题标题】:Android Studio - Unrecognized state_cheked attribute in selectorAndroid Studio - 选择器中无法识别的 state_cheked 属性
【发布时间】:2020-12-24 10:49:37
【问题描述】:

我是 Android Studio 和 Kotlin 的新手,遇到了一个有趣的问题。

我的 Android Studio 无法识别某些属性。我找不到任何答案。

更新 Android Studio 和使用 Gradle 文件同步项目都没有帮助。

例如,在我的选择器中,state_chekedstate_pressed 属性不起作用。

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">
    <item android:state_checked="true" android:drawable="@drawable/ic_home22"/>
    <item android:drawable="@drawable/ic_home22" android:state_pressed="false"/>
    <item android:drawable="@drawable/ic_home" />

</selector>

我得到的错误是Unknown attribute android:state_checked

很高兴得到任何帮助,谢谢。

【问题讨论】:

  • 布局文件有同样的问题吗?

标签: android kotlin


【解决方案1】:
猜你喜欢
  • 1970-01-01
  • 2022-01-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-13
  • 1970-01-01
  • 2018-01-22
相关资源
最近更新 更多