I have follow this post to make ImageButton in android
android image button
The image appears to the button but it has some background , my Image is a png image and I want the button to be transparent background
any one help please
You can specify a transparent background for the image button. The result will be a clickable image that acts like a button but can look like whatever you want it to look like. Just set android:background="@null" for the image button.
Save the XML file in your project res/drawable/ folder and then reference it as a drawable for the source of your ImageButton (in the android:src attribute). Android will automatically change the image based on the state of the button and the corresponding images defined in the XML.
An ImageButton is an AbsoluteLayout which enables you to specify the exact location of its children. This shows a button with an image (instead of text) that can be pressed or clicked by the user.
add this line to your ImageButton xml layout.
android:background="@null"
Here's an alternative solution that worked for me:
android:background="@android:color/transparent"
As Sunny said, add it to the ImageButtons' XML layout
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With