###前提・実現したいこと
ボタン押下時に背景色を変えるのとそのボタンに枠線を表示させたい
###発生している問題・エラーメッセージ
現状ボタンタップ時に背景色は変わるのですが枠線が表示されないくて困っています。
ご教授よろしくお願いいたします。
###ソースコード
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <color android:color="#808080" /> <shape android:shape="rectangle"> <stroke android:width="1dp" android:color="#ff0000"/> </shape> </item> <item android:state_pressed="false"> <color android:color="#c0c0c0" /> <shape android:shape="rectangle"> <stroke android:width="1dp" android:color="#ff0000"/> </shape> </item> </selector>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <shape android:shape="rectangle"> <stroke android:width="0.5dp" android:color="#696969"/> <solid android:color="#808080" /> </shape> </item> <item android:state_pressed="false"> <shape android:shape="rectangle"> <stroke android:width="0.5dp" android:color="#696969"/> <solid android:color="#c0c0c0" /> </shape> </item> </selector>
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。