[英]Problems Android studio No resource found that matches the given name
I've been searching for hours and I can't figure what's happening on my Android studio project that is broken. 我一直在搜索数小时,但无法弄清楚Android Studio项目中发生了什么事。
I've just started a new project, did some coding and when I get to layout development just tried to add a custom toggle buton, have add a png file to drawables and a selector XML to change background, of course I've selected it on main layout XML. 我刚刚开始一个新项目,做了一些编码,当我开始布局开发时,尝试添加自定义切换按钮,在drawables中添加png文件,并使用选择器XML更改背景,当然我已经选择了它在主布局XML上。
Anyway when I try to run it, I get always the same error 无论如何,当我尝试运行它时,总是出现相同的错误
Error:(13, 30) No resource found that matches the given name (at 'background' with value '@drawable/boton_on').
That's my selector if this helps: 如果有帮助,那就是我的选择器:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/boton_on" android:state_checked="true"/>
<item android:drawable="@drawable/boton_on" android:state_checked="false"/>
</selector>
buton_on,未找到图片或xml:此处可能不存在或拼写错误(可能是button_on)(使用ctrl +空格建议可避免此类问题)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.