I can set ImageButton background transparent in layout.xml
using:
android:background="@android:color/transparent"
How I can acomplish same thing using java code?
Something like ib.setBackgroundColor(???);
I can set ImageButton background transparent in layout.xml
using:
android:background="@android:color/transparent"
How I can acomplish same thing using java code?
Something like ib.setBackgroundColor(???);
This should work -
imageButton.setBackgroundColor(android.R.color.transparent);
Try like this
OR
include this in your .xml file in res/layout
simply use this in your imagebutton layout
using
or
doesn't give perfect transparency
This is the simple only you have to set background color as transparent
DON'T USE A TRANSAPENT OR NULL LAYOUT because then the
button
(or the generic view) will no more highlight at click!!!Use this in the button specifications
This requires API 11
Do it in your xml