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
544
votes
23 answers

How to have a transparent ImageButton: Android

This is what I tried to get a…
Namratha
  • 16,630
  • 27
  • 90
  • 125
208
votes
18 answers

jQuery UI Dialog - missing close icon

I'm using a custom jQuery 1.10.3 theme. I downloaded every straight from the theme roller and I have intentionally not changed anything. I created a dialog box and I get an empty gray square where the close icon should be: I compared the code that…
Xion Dark
  • 3,374
  • 2
  • 15
  • 23
179
votes
8 answers

Fit Image in ImageButton in Android

I have 6 ImageButton in my activity, I set images through my code in them ( not using xml). I want them to cover 75% of the button area. But where as some images cover less area, some are too big to fit into the imageButton. How to programatically…
Rohit
  • 6,941
  • 17
  • 58
  • 102
161
votes
4 answers

Difference between a clickable ImageView and ImageButton

I'm just wondering if there is any significant difference between an ImageView that's set to be clickable, compared with an ImageButton? Is there any reason for using one over the other? Is there any restriction on the drawable for an ImageButton…
yjw
  • 3,394
  • 4
  • 20
  • 20
140
votes
12 answers

How to show the text on a ImageButton?

I have an ImageButton and I want to show a text and an image on it. But when I try on emulator:
Võ Quang Hòa
  • 2,688
  • 3
  • 27
  • 31
110
votes
6 answers

Apply Material Design Touch Ripple to ImageButton?

I have an imagebutton that doesn't respond with a touch animation when it is clicked because it is a static image unlike regular buttons on lollipop which come with the built in ripple effect. I would like to add the material design ripple touch…
sanic
  • 2,065
  • 4
  • 20
  • 33
90
votes
6 answers

Android ImageButton with a selected state?

If I was using an ImageButton with a selector for its background, is there a state I can change which will make it change its appearance? Right now I can get it to change images when pressed, but there seems to be no "highlighted" or "selected" or…
Joren
  • 9,623
  • 19
  • 63
  • 104
89
votes
7 answers

How to set transparent background for Image Button in code?

I can set ImageButton background transparent in layout.xml using: android:background="@android:color/transparent" How I can acomplish same thing using java code? Something like ib.setBackgroundColor(???);
Peter
  • 909
  • 1
  • 9
  • 9
87
votes
11 answers

How to remove ImageButton's standard background image?

In ImageButton I want to remove the standard button background image. In http://developer.android.com it is said, that one must define his\her own background image or set the background color to be transparent. I tried to set a black background, but…
lomza
  • 9,412
  • 15
  • 70
  • 85
76
votes
5 answers

Difference between Button with image, ImageButton, and clickable ImageView?

Is there any difference between Button with image, ImageButton and clickable ImageView?
Snake
  • 14,228
  • 27
  • 117
  • 250
69
votes
10 answers

How do I change the tint of an ImageButton on focus/press

I have an ImageButton in my app and I need to change the tint of the image when the button is pressed/focused. I have the ImageButton set to get its src from an XML file which as follows:
Joseph Earl
  • 23,351
  • 11
  • 76
  • 89
69
votes
8 answers

Imagebutton change programmatically?

I'm trying to change the image of the ImageButton programmatically. I'm trying to copy this code, but the setBackgroundDrawable is already deprecated. public void giveClue(View view) { Drawable replacer =…
newbie
  • 14,582
  • 31
  • 104
  • 146
60
votes
4 answers

Padding not working on ImageButton

In an app I am working on, I have several ImageButtons. Each ImageButton has a background and content in the form of a drawable. Right now the drawable is at maximum size within the confines of the ImageButton, but I want it to scale down so I need…
Zero
  • 1,864
  • 3
  • 21
  • 39
57
votes
7 answers

Can't click on ListView row with imagebutton

I have trouble with a ListView. Its items (rows) have an ImageButton. The ImageButton has android:onClick set, so this onClick event is working, but click on row doesn't work. If I remove the ImageButton from the row item, click on row works…
yital9
  • 6,544
  • 15
  • 41
  • 54
54
votes
12 answers

Error : tag requires a 'drawable' attribute or child tag defining a drawable

I created a state-list selector file item_bg_selector.xml in the drawable folder like this :
500865
  • 6,920
  • 7
  • 44
  • 87
1
2 3
99 100