<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:color="#ff0000"/>
<item android:state_focused="true"
android:color="#0000ff"/>
<item android:color="#00ff00"/>
</selector>
I have this selector which I'm trying to use to change the background of a Linearlayout. Whenever I try to apply it, however I always get this error message:
org.xmlpull.v1.XmlPullParserException: Binary XML file line #4: tag requires a 'drawable' attribute or child tag defining a drawable
Obviously, it want me to use the drawable attibute but I'm not sure how to do that and change the background like I want to.
android:drawable="@color/red"
and add this in every item with diffrent color....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With