Android: Using selector to set background color for image view

后端 未结 5 1007
情歌与酒
情歌与酒 2020-12-15 22:45

I am trying to set the background color of an image view.

 

        
5条回答
  •  被撕碎了的回忆
    2020-12-15 23:35

    Your Logcat:

    E/AndroidRuntime( 4196): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #3: tag requires a 'drawable' attribute or child tag defining a drawable

    LogCat is pointing out that your tag should include android:drawable tag.

    You selector file should look like this:

     
         
             
         
         
    
    

提交回复
热议问题