Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transparent background in ImageButton with ripple effect?

Tags:

I want to programmatically remove the grey background in ImageButton. I tried many method of removing it like -

imageButton.setBackgroundDrawable(null); 

but on implementing them, I don't get the ripple effect on the ImageButton on touch. (No highlighting on touch).

Is there any way to remove the background but preserve the ripple effect or highlight.

like image 754
Confuse Avatar asked May 21 '15 04:05

Confuse


Video Answer


1 Answers

If android:background="?attr/selectableItemBackground" this works than I believe this answer should solve your problem:

https://stackoverflow.com/a/28087443/2534007

like image 131
Mohib Irshad Avatar answered Sep 20 '22 17:09

Mohib Irshad