Is it possible to set the background of an ImageButton to "@null" and still choose an onClick highlight color?
Many thanks
EDIT
I am using the following xml on my ImageButton so that the android background is null but my custom background is:
<ImageButton
android:id="@+id/m1_btn"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@null"
android:src="@drawable/pause"
tools:ignore="ContentDescription" />
Then my buttons background is controlled in my Java like so:
pp_btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
i +=1;
if (i % 2 == 0) {
pp_btn1.setImageResource(R.drawable.pause);
} else {
pp_btn1.setImageResource(R.drawable.play);
}
}
});
With this explained, is there a way of still achieving the button highlight onClick?
Many thanks