添加样式我的风格我不能使用选择
<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>
因此,所有尝试后没有任何反应
你的文件是否真的名为'Arrow.xml'(第一个字母的上部)? – hsz
对不起,我犯了一个错误arrow.xml –