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
5
votes
3 answers

Android: Center align ImageButtons

I have 2 ImageButons like this I have tried everything to make it align properly in center of screen. As being new to android i don't have any other clues of what to do. How can i achieve my goal of aligning these 2 Imagebuttons in center of…
Sarfarosh Lakhan
  • 53
  • 1
  • 1
  • 5
5
votes
2 answers

Where Should I put the PNG file relate to ImageButton in Android?

I'm very new to Android. I created a ImageButton. The main.xml includes code segment as following.…
dinesh707
  • 12,106
  • 22
  • 84
  • 134
5
votes
1 answer

How to make any imagebutton a menu button

I have an imageButton in a xml file. Now want to make it a menu button, so that when a user click on the button it should show the drop down menus. But I am not able to figure out what are the possible solution(s). Can anyone help?
user8274134
5
votes
5 answers

Android ImageButton state not changing

I have an issue with my ImageButton not changing state. When I click, or rather touch, the button it stays as the same image. Here is the XML I am using as a selector.
Doug Goldberg
  • 51
  • 1
  • 2
5
votes
2 answers

Android, remove custom button border

I used this selector code for my custom button (simple.xml)
Jovan
  • 4,684
  • 13
  • 64
  • 98
5
votes
2 answers

ImageButton in Android homescreen widget

I have a homescreen widget with an imagebutton. I have the button working with a pending intent, but I can't seem to figure out how to change the button image when it is pressed. I tried using a selector and it works in my widget test activity, but…
Josh
  • 51
  • 1
  • 2
5
votes
1 answer

How to create a round Button with a corner overlay

I would like to create a Button which looks like this: This is what I tried so far:
Javier
  • 51
  • 2
5
votes
5 answers

Android ImageButton - How to change the image when button is clicked?

If the button was clicked I want to turn on the wifi and also change the Image of ImageButton, but I do not know how to change it I have also tried this from how to change the image of a button with every click? but is isn't working: boolean…
Ali
  • 157
  • 2
  • 3
  • 13
5
votes
4 answers

ListView ImageButton Set Ringtone

I want to do the following link: http://imagizer.imageshack.us/v2/800x600q90/42/gbs4.jpg But when I press the ImageButton, I want the sound to be put as a ringtone. Here is my code: public class ListViewAdapter extends BaseAdapter { …
user3225759
  • 127
  • 1
  • 10
5
votes
2 answers

Making Android src image resource fill button area

I have the following XML:
Andy A
  • 236
  • 3
  • 12
5
votes
3 answers

ImageButton in Android xml (image is too small and horrible resolution)

I have the following for 3 Imagebuttons. The way the code stands below, the three buttons look the same. Problems: The image doesn't fill the size of the button completely The resolution of the images are bad. I have the images saved in all…
emily
  • 467
  • 2
  • 6
  • 12
5
votes
3 answers

android ImageButton do not stretch image

How can I prevent the ImageButton from stretching the image? Using this snippet:
Klaus Nji
  • 18,107
  • 29
  • 105
  • 185
5
votes
3 answers

get resource from a fragment

I'm trying to change the source of an ImageButton in android within a fragment. I want to use the method Image.setImageResource() , however i can't use getResources() within the fragment. is there a way round this? getActivity().getResources() does…
AKTStudios
  • 105
  • 1
  • 3
  • 10
5
votes
5 answers

android change button icon when clicked

I want to know if there is a way of changing a button image when it is clicked. Initially the button has a pause icon. When it is clicked I want the play icon to be displayed. Each time the button is clicked the icon should vary between play and…
user1909680
  • 95
  • 1
  • 3
  • 12
5
votes
2 answers

Gridview with layout (imageview + imagebutton) for every value

Is it possible to make a gridview that has instead of a grid of pictures, a grid of pictures with a small imagebutton below every one of them?
rosu alin
  • 5,674
  • 11
  • 69
  • 150