Questions tagged [android-imagebutton]

Displays a button with an image (instead of text) that can be pressed or clicked by the user.

Displays a button with an image (instead of text) that can be pressed or clicked by the user.
By default, an ImageButton looks like a regular Button, with the standard button background that changes color during different button states.
The image on the surface of the button is defined either by the android:src attribute in the XML element or by the setImageResource(int) method.

To remove the standard button background image, define your own background image or set the background color to be transparent.

To indicate the different button states (focused, selected, etc.), you can define a different image for each state.
E.g., a blue image by default, an orange one for when focused, and a yellow one for when pressed. An easy way to do this is with an XML drawable "selector."

Reference page: http://developer.android.com/reference/android/widget/ImageButton.html

511 questions
3
votes
0 answers

C# Xamarin Invisible Imagebutton's Background

I have a very Simple Question, But i did'nt find it from google. Question: How Can i Set Imagebutton's BackRound invisible or Alpha What i tried but did'nt work: android:background="Alpha"
Ingmar05
  • 501
  • 2
  • 8
  • 25
3
votes
2 answers

How to give accent color to icon of imagebutton?

I am following material design tutorials as well as icons to develop an application, but I found an app which changes icons color on click. I want to do the same. How I can build such things? Please help me to out of this problem, also on button…
3
votes
3 answers

How to set a View Visible on a specific time?

I'm trying to make a Video Player android application in which I have to display an ImageButton on the top of Video on a specific Time. This is my layout
3
votes
2 answers

Android Image Button tint only one color

I am writing an app where I have an icon on an image button that looks like a paintbrush with paint on it. When ever the user changes colors, I want the paint on the brush to change to the chosen color. I have tried making the icon's paint white…
spectacularbob
  • 3,080
  • 2
  • 20
  • 41
3
votes
1 answer

Visibility of image button not working for lollipop devices and above

I have an ImageButton that is by default invisible :
VasFou
  • 1,561
  • 1
  • 22
  • 39
3
votes
0 answers

Customize size of a button widget in android

So i have this idea to create an activity that have only buttons which split the screen as presented in the picture: I was thinking about creating some functions for each button. those functions will be dependent on the y and x axis of the…
kitsuneFox
  • 1,243
  • 3
  • 18
  • 31
3
votes
1 answer

Android set background color button pressed

I would like to change the background color of my ImageButton on pressed event. Here is what i am done :
wawanopoulos
  • 9,614
  • 31
  • 111
  • 166
3
votes
1 answer

Add another image in image button with animation

I'm a rookie and noob but is it possible to add another image when an image button with animation is pressed?
3
votes
2 answers

Custom image button with clicked functionality

I know this is a stupid question but a google search did not give me a good answer. I have a button in my activity but when I press it, I cannot visually see it. Although the button works just fine. I know I have to do something in the xml file but…
streetsoldier
  • 1,259
  • 1
  • 14
  • 32
2
votes
1 answer

How can I remove white spaces around an ImageButton?

How can I remove the white spaces around these ImageButtons? This is sample code for one one of the ImageButton:
11_22_33
  • 116
  • 1
  • 15
2
votes
1 answer

ImageButton does not resize the image

Why ImageButton does not resize the image? Preview Image Image name is r.png
Taha Sami
  • 1,565
  • 1
  • 16
  • 43
2
votes
2 answers

Android Imagebutton is clipped

I'm having issues with my Activity and an ImageButton inside it. It looks like it is clipping: This is the XML of the corresponding activity: