简体   繁体   English

问题Android Studio找不到与给定名称匹配的资源

[英]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.

相关问题 Android Studio-找不到与给定名称匹配的资源 - Android Studio - No resource found that matches the given name Android Studio出现问题! 无法解析符号R,找不到与给定名称匹配的资源 - Problems with Android Studio! Cannot resolve symbol R, No resource found that matches the given name Android Studio:未找到与给定名称匹配的资源:attr&#39;android:actionModeShareDrawable&#39; - Android Studio : No resource found that matches the given name: attr 'android:actionModeShareDrawable' Android错误:找不到与Android Studio中的给定名称匹配的资源 - Android Error: No resource found that matches the given name in Android Studio 错误未找到与给定名称匹配的资源:Android Studio中的attr&#39;borderWidth&#39; - Error No resource found that matches the given name: attr 'borderWidth' in Android Studio 字体android studio 3错误:找不到与给定名称匹配的资源 - Error with fonts android studio 3: No resource found that matches the given name Android Studio - 错误:找不到与给定名称匹配的资源:attr&#39;metaButtonBarButtonStyle&#39; - Android Studio - Error: No resource found that matches the given name: attr 'metaButtonBarButtonStyle' Android Studio:找不到与给定名称匹配的资源:attr&#39;searchViewTextField&#39; - Android Studio: No resource found that matches the given name: attr 'searchViewTextField' 找不到与给定名称Android匹配的资源 - No resource found that matches the given name Android 找不到与给定名称Xamarin Android匹配的资源 - No Resource found that matches the given name Xamarin Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM