Questions tagged [imagebutton]

An image button is a button that displays an image, regardless of platform

An image button is a button that displays an image, regardless of platform

1801 questions
4
votes
2 answers

ImageButton change src

Change the ImageButton src Here is the xml for the tag:
Kim Vu
  • 584
  • 9
  • 25
4
votes
2 answers

Android Studio: Using ImageButton to start new activity crashes the app

I am designing an app that has a home screen with 6 image buttons, that all start new activities. Currently when I press the button, the app crashes. This is strange however as I have done this project with regular buttons and it works fine, and I…
dsis
  • 103
  • 6
4
votes
4 answers

Android ImageButton click not working sometimes

I'm using ImageButton in my xml, like this:
pratiti-systematix
  • 792
  • 11
  • 28
4
votes
1 answer

Two different parameter types (cast Object to Type)

I want to call a method but the parameter could be a Button or an ImageButton. I call the method two times with different parameter types as Objects. In my method attributesOfButton I want to assign the corresponding button type like in the code…
Maddy
  • 570
  • 1
  • 7
  • 27
4
votes
1 answer

Return value of ScriptManager.RegisterStartupScript confirm box in code behind

There are two confirm boxes on an ImageButton - first one is regular one saying "Are you sure you want to delete it?" (that is from the OnClientClick event on Client side ). If 'Yes' is selected, then it goes into the server side code, where another…
Nalini
  • 213
  • 1
  • 3
  • 12
4
votes
2 answers

Android widget ImageButton loses image when screen is rotated

I have a widget on my home screen with several ImageButtons which have default background images. Through the configuration activity, I can change the image on any of the ImageButtons. The problem is that when the screen is rotated, the image on the…
alejom99
  • 177
  • 3
  • 11
4
votes
2 answers

What is the value of R.id.ImageButton?

I have sixteen image buttons, so I create an array of Image Buttons. I would like to initialize them with a for loop, I would not like to do that one by one, though I do not know if it is possible. For one imagebutton, it would be something, like…
masm64
  • 1,222
  • 3
  • 14
  • 31
4
votes
3 answers

LibGDX ImageButton image not to scale?

The red square is the button's boundary, while the image remains centered at 32x32px. I've tried using button.getImage() to set position and size to the button's values, but it doesn't seem to have any effect.
oracleCreeper
  • 199
  • 1
  • 3
  • 10
4
votes
2 answers

Android: How do I switch the image of an ImageButton when the user releases the button?

I'm trying to make it so that as long as a user is touching the button, it shows one image, and when the user releases the button, it goes back to a default image. I'm trying to use a selector to make this happen:
Ryan
  • 281
  • 2
  • 9
4
votes
5 answers

How to get image from an ImageButton?

I'm not sure about the code, but I tried doing this: ImageButton stuff = (ImageButton) createView.findViewById(R.id.stuff); int stuff2 = stuff.getId(); champs.setImageResource(stuff2); But that didn't work, the Imagebutton was shrinked for some…
Piofmc
  • 365
  • 2
  • 4
  • 19
4
votes
3 answers

Selected state for ImageButton

I have image Button like below.
saravanan
  • 5,339
  • 7
  • 45
  • 52
4
votes
1 answer

How to drag and drop an overlay ImageButton?

I have this overlay button that is being activated using a service. So it is a background button. You can see the button even if the other programs are running. However I have problem with adding a feature on the button where when I hold it, I can…
The One
  • 1,085
  • 6
  • 13
  • 25
4
votes
7 answers

Android ImageButton without border but still with click indication

How to create an ImageButton without border (just the image should be visible)? One could achieve this by setting imageButton.setBackgroundDrawable(null), but this also removes the focus and selection colors. The goal is that initially only the…
Witek
  • 6,160
  • 7
  • 43
  • 63
4
votes
4 answers

How to add button caption on image button

I am going to use image button in my app And I need to display button caption on the button I'm using this code but it did not show caption
Tikitaka
  • 460
  • 2
  • 7
  • 15