我有风格
<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>
我使用选择器 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>
问题是我无法理解 - 如果它有效?
<?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>
因此,在所有尝试之后什么都没有发生