押された状態、フォーカスされた状態、通常の状態の ImageButton を作成しようとしています。ここでImageButtonの紹介を読みました
セレクター XML ファイルを /res/drawable/ に保存しました。も設定しandroid:src="@drawable/my_selector"
ます。
my_selector.xml ファイル:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/btn_unfocus" /> <!-- default -->
<item android:state_pressed="true"
android:drawable="@drawable/btn_onpress" /> <!-- pressed -->
<item android:state_focused="true"
android:drawable="@drawable/btn_onfocus" /> <!-- focused -->
</selector>
私は正しい ImageButton を行ったと思います。しかし、それは私にはうまくいきませんでした。
ここで何が問題なのですか?
ご意見をお聞かせください。