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
24
votes
1 answer

UWP xaml: How to display a button with icon and text in it?

How can I display an image/icon AND text in a button?
23
votes
4 answers

android image button tooltip

I'm trying to build an app with image buttons that work like the action bar but i can't get them to show a tooltip on long press.
user3536471
  • 231
  • 1
  • 2
  • 3
22
votes
5 answers

Android highlight an imagebutton when clicked

I am using an ImageButton. But I don get the highlight when clicked. I googled and many suggested to use selector where another image is displayed. Is there any way around this. by using only one image and highlighting it or giving it a glow effect.…
Droidme
  • 1,223
  • 6
  • 25
  • 45
21
votes
7 answers

How to use setImageUri() on Android

Can you help me please? I've tried : ImageButton imgbt=(ImageButton)findViewById(R.id.imgbutton); Uri imgUri=Uri.parse("/data/data/MYFOLDER/myimage.png"); imgbt.setImageUri(imgUri); but I didn't see anything, simply a void button.
ilredelweb
  • 3,091
  • 4
  • 17
  • 14
20
votes
3 answers

How do I set the selected state of an image button with xml

I have an image button as defined below.
Jay Askren
  • 10,282
  • 14
  • 53
  • 75
19
votes
3 answers

how to set an onclick listener for an imagebutton in an alertdialog

I have a layout with an ImageButton that is inflated in an AlertDialog, where/how should I set an onClick listener? Here's the code I tried using: ImageButton ib = (ImageButton) findViewById(R.id.searchbutton); ib.setOnClickListener(new…
Yvonne
  • 231
  • 1
  • 2
  • 6
19
votes
3 answers

ASP.NET Master page DefaultButton override

I have a master page with a form element and the defaultbutton attribute set to a server-side ImageButton. On one of my pages I want to "override" the masterpage defaultbutton attribute by setting the Forms DefaultButton in the Page_Load event. i.e…
Dieter G
  • 930
  • 2
  • 9
  • 24
18
votes
1 answer

Android Set ImageButton as Toggle

How can I have an imagebutton stay in the 'pressed' state when it is clicked? Basically I just want the background to be the depressed background, but I can't figure out how to set it. At the moment, I've just copied the selected button background…
Kleptine
  • 5,089
  • 16
  • 58
  • 81
18
votes
6 answers

Android custom ListView with ImageButton is not getting focus

I am developing an app for android TV. I have a listview with an ImageButton + Textviews as children. As TV does not take touch events but uses D-PAD or trackball remote I have to get focus on all clickable items so that user knows where the focus…
nidhi_adiga
  • 1,114
  • 1
  • 16
  • 27
17
votes
3 answers

How do I programmatically change the ImageButton src target when a condition is met?

I have a school project where I am trying to get a flashlight app going. For the on/off ImageButton, I want to have 4 custom images. If flashlight is off: -turn_on.png (default) -turn_on_pressing.png (state pressed = true) If flashlight is…
John Riggs
  • 484
  • 1
  • 4
  • 17
16
votes
4 answers

imagebutton gives me error: [Accessibility] Missing contentDescription attribute on image

[Accessibility] Missing contentDescription attribute on image What does this error mean and how can I fix it?
user1091368
  • 359
  • 1
  • 4
  • 17
16
votes
5 answers

Android: how to set the height/width of the src image of a ImageButton?

Android: how to set the height/width of the image(src image intead of the background) of a ImageButton? I want to set the height/width of the top level image(not the background) image, the size of image should be customized instead of fullfill the…
George_BJ
  • 596
  • 2
  • 9
  • 21
16
votes
6 answers

Windows Phone 7 Image Button

I need to create an Image Button for my application like web-oriented style. I have an image 20x20 pixel and want an image button with the same dimension of the image. I tried to set this inside my xaml but it doesn't work:
16
votes
3 answers

How to get Image Resource

How should I get current image resource of an imageButton? I need something like this: imageButton.getImageResource(); Thanks a lot
MOHRE
  • 1,096
  • 4
  • 15
  • 28
15
votes
10 answers

How To Use Multiple TouchDelegate

i have two ImageButtons, each inside a RelativeLayout and these two RelativeLayouts are in another RelativeLayout, i want to set TouchDelegate for each ImageButton. If normally i add TouchDelegate to each ImageButton and it's parent RelativeLayout…
Junaid
  • 1,179
  • 2
  • 18
  • 35