Error Parsing XML for android:drawable

前端 未结 3 1482
旧时难觅i
旧时难觅i 2021-01-21 20:06

Hi I am facing a problem I want my application to pick up resources from the framework. Here is my code snippet of an xml.

For this to be achieved following ch

相关标签:
3条回答
  • 2021-01-21 20:46

    i think i had the same problem, it seems to be a bug in the android eclipse-plugin. the solution is the same as for this question (close eclipse and restart it): android include tag - invalid layout reference

    0 讨论(0)
  • 2021-01-21 20:47

    The error

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

    has to do with the format of your xml, you are setting something like

    <item android:background="@foo-value-here" />
    

    What the error is telling you is that it should be like this

    <item android:drawable="@foo-value-here" />
    
    0 讨论(0)
  • 2021-01-21 20:50

    Also make android:drawable the first attribute of item tag - it worked for me.

    0 讨论(0)
提交回复
热议问题