I have styles
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="TextStyle" >
<item name="android:textSize">8sp</item>
<item name="android:textColor">#0A0A0A</item>
<item name="android:typeface">serif</item>
</style>
<style name="TextStylePressed" >
<item name="android:textSize">18sp</item>
<item name="android:textColor">#0A0A0A</item>
<item name="android:typeface">serif</item>
<item name="android:textStyle">bold</item>
<item name="android:background">#C2C2C2</item>
</style>
</resources>
and I use selector arrow.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@style/TextStylePressed" android:state_selected="true"/>
<item android:drawable="@style/TextStylePressed" android:state_pressed="true"/>
<item android:drawable="@style/TextStylePressed" android:state_focused="true"/>
<item android:drawable="@style/TextStyle" />
</selector>
The problem is that I can not understand – if it works?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@drawable/arrow" // <---- Framed here
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/arrow" // <---- then here
android:orientation="vertical" >
</LinearLayout>
Consequently, after all attempts nothing happens
AFAIK selectors can only be defined to select a
drawableand not any otherattribute. If you check the doc , it compiles to StatelistDrawable, So i believe it can only be used for drawables