有効で、押されていないpngボタンがあります。ユーザーがボタンをクリックすると、pngだけを暗くしたい。私はこのようなものが必要です:
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
//normal button with background my_button.png
<item
android:state_enabled="true"
android:drawable="@drawable/my_button" //my_button.png
/>
//pressed button with background my_button.png overlayed by 50% black
<item
android:state_pressed="true"
android:state_enabled="true"
>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<bitmap android:src="@drawable/my_button"/>
<color android:color="#00000088"/>
</RelativeLayout>
</item>
</selector>
それを行う方法はありますか?または、別の png ファイルが必要ですか?