Exception android.content.res.Resources$NotFoundException: File res/drawable/my.xml from drawable resource ID

前端 未结 2 753
没有蜡笔的小新
没有蜡笔的小新 2020-12-31 03:00

Whats wrong with this xml, I am trying to get a button press feel. I am getting a exception, I am unable to understood. ResourceNotFound

In my layout.xm

2条回答
  •  时光说笑
    2020-12-31 03:51

    Once Try this

    In selector state it is required to add drawable and in your case you wants to add color in selector state.So it is possible to create drawable using color in resource. It will work as ColorDrawable

    Please check below code

    
    
            
            
    
        
    

    values/string.xml for color

     #AAAAAA
    #777777
    

提交回复
热议问题