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
51
votes
12 answers

How to place button inside of EditText

I want to place an image button inside of EditText, but I don't have Idea please tell me how to do so as shown in the figure . Thanks
Arshad Ali
  • 3,082
  • 12
  • 56
  • 99
48
votes
5 answers

Rounded corners android image buttons

I am trying to round corners on an android ImageButton, the code looks like this;
CBreeze
  • 2,925
  • 4
  • 38
  • 93
47
votes
1 answer

Adding a button to the title bar Xamarin Forms

Haven't been able to find quite the right answer for this yet. I want to add a button into the navigation / title bar at the top of a Xamarin Forms Navigation Page. Note that I need to know a method that will work on android, I'm not interested in…
Jobalisk
  • 728
  • 1
  • 6
  • 17
43
votes
10 answers

How to add image for button in android?

How can I add an image to a button, rather than text?
Adham
  • 63,550
  • 98
  • 229
  • 344
38
votes
7 answers

Android Imagebutton change Image OnClick

I just added a new drawable folder under res folder. In the drawable folder, i copied the ic_launcher.png file from drawable-hdpi folder. I wanna change the standard ImageButton image through the new one when i press the button. I wrote some code,…
user1205415
  • 605
  • 1
  • 7
  • 22
37
votes
9 answers

How do I keep the aspect ratio on image buttons in android?

I have 5 square ImageButtons that I want to have lined up side by side on the bottom of the screen. I have each one set (different id's) as:
clayton33
  • 4,176
  • 10
  • 45
  • 64
35
votes
5 answers

disable an ImageButton?

I wanted to leave an ImageButton is disabled (not clickable) but have used android: enabled = "false" and does't work. Does anyone know how to disable an ImageButton?
Pedro
  • 451
  • 2
  • 6
  • 5
32
votes
4 answers

How to pass multiple values through command argument in Asp.net?

I have ImageButton with CommandArgument attribute which is having multiple Eval value. When I click one of them I want to pass values to ImageButton2_Click event but it does not work because Command arguments is null.
leventkalay92
  • 573
  • 3
  • 11
  • 28
30
votes
5 answers

ImageButton in Android with transparent background

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
Amira Elsayed Ismail
  • 9,216
  • 30
  • 92
  • 175
28
votes
8 answers

Disable an ImageButton

This looks easy, but I'm not able to disable an ImageButton. It continues to receive click events, and its appearance don't change like a standard Button would. There are some similar questions on SO, but they don't help me. Even with a very simple…
Dalmas
  • 26,409
  • 9
  • 67
  • 80
28
votes
3 answers

How to add image(left) and text on button

How to add image(left) and text on button? For illustration:
Roy Lee
  • 10,572
  • 13
  • 60
  • 84
27
votes
8 answers

ImageButton in Android

Can anybody tell me how to resize the imageButton to fit the image exactly? This is the code that I tried, but the image is placed at the position that I am locating using android:scaleType, but I am not able to reduce the size of imageButton.…
Nandagopal T
  • 2,037
  • 9
  • 42
  • 54
27
votes
3 answers

Transparent background in ImageButton with ripple effect?

I want to programmatically remove the grey background in ImageButton. I tried many method of removing it like - imageButton.setBackgroundDrawable(null); but on implementing them, I don't get the ripple effect on the ImageButton on touch. (No…
Confuse
  • 5,646
  • 7
  • 36
  • 58
25
votes
7 answers

How can I stretch the image in imagebutton to the whole area of the imagebutton?

Here is a picture that will help you understand my problem: I want to stretch the image shown inside ImageButton to the whole area of the ImageButton. As you can see, the picture with the number 1 only take about 95% of the ImageButton and you can…
user2051993
  • 276
  • 1
  • 3
  • 6
24
votes
3 answers

Android ImageButton -- can't get image in the center

I want to create an Android ImageButton in the xml file with a background image, and a smaller icon on top of that, right in the center. For some reason, it's not obvious how to do it, and documentation is no…
executor21
  • 4,532
  • 6
  • 28
  • 38