android - Android Studio - 选择器中无法识别的 state_cheked 属性
问题描述
我是 Android Studio 和 Kotlin 的新手,我遇到了一个有趣的问题。
我的 Android Studio 无法识别某些属性。我找不到任何答案。
更新 Android Studio 和使用 Gradle 文件同步项目都没有帮助。
例如,在我的选择器中,属性state_cheked
并state_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
.
很高兴得到任何帮助,谢谢。
解决方案
看起来是缓存问题,试试这些不同的解决方案
推荐阅读
- import - 导入的 protobuf 是否应该在 gRPC 中有选项?
- python - PySimpleGUI 输出元素换行符
- javascript - 自定义 Javascript 在 Wordpress 中不起作用
- c# - 如何在 Xamarin 的同一 API 中传递表单数据和 json?
- flutter - 使用ffmpeg向视频添加音频不起作用
- javascript - 使用递归函数时如何避免模块之间的循环依赖?
- flutter - 在颤振/飞镖中与图像下的小部件交互
- javascript - 傀儡师的麻烦。或者,至少,javascript 的麻烦;你决定,请
- javascript - NPM 版本历史 API
- javascript - 基于嵌套对象数组的过滤器