TextViewを押すと、異なる色の背景でペイントしたいのですが。以下のxmlには、ButtonとTextViewが含まれており、どちらも背景としてセレクターを指定しています。ボタンは期待どおりに機能しますが、TextViewを押しても色は変わりません。TextViewでこれを機能させる方法はありますか?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:text="temporary text view"
android:layout_width="wrap_content"
android:layout_height="100dip"
android:background="@drawable/blackselector"
/>
<Button
android:text="temporary button"
android:layout_width="wrap_content"
android:layout_height="100dip"
android:background="@drawable/blackselector"
/>
</LinearLayout>
セレクター.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<color android:color="#FF0000" />
</item>
<item>
<color android:color="#00FF00" />
</item>
</selector>