ボタンがあり、ボタンをクリックすると、ボタンの画像が変わります。すべて問題ないと思いますが、ボタンをクリックすると、背景ボタンが一瞬(これを選択している間)変更され、背景ボタンが最初の背景色になります:(私の問題は何ですか??
contact_selector.xml:
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@drawable/contactpress"></item>
<item
android:state_focused="true"
android:drawable="@drawable/contactpress"></item>
<item
android:drawable="@drawable/contact"></item>
</selector>
activity_test.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:id="@+id/frame"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white"
android:layout_above="@id/btn"></FrameLayout>
<Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/contact_selector"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
ありがとう...