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
8
votes
2 answers

Creating irregular shaped ImageButton with different click states

I created an ImageButton with a selector for pressed and non-pressed states, and this works fine. But the button has an irregular shape and I only want it clickable where the underlying rectangular image is non-transparent. So I implemented an…
user134926
  • 291
  • 3
  • 9
7
votes
2 answers

animating ImageButton in android?

I am really new to animations in android (and pretty much anything else). Is there a way to animate an ImageButton? I just want to rotate the button for sometimes. Thats all. Any help ? Thanks.
Ahsan
  • 2,964
  • 11
  • 53
  • 96
7
votes
5 answers

DataGridView Image Button Column

I want to add image button in datagridviews column . I added the datagridview with datagridviewbuttonColumn but I don't set the image to this . I want to add image with button in datagridviews column and when click this button datagridview row edit…
thinzar
  • 1,530
  • 5
  • 25
  • 46
7
votes
3 answers

how to change the ImageButton's image when it is pressed and released?

I want that in my android application, the ImageButton change its image when it is pressed and released, and when it is pressed released again, the image for ImageButton will be changed back , how to do that?
David
  • 2,691
  • 7
  • 38
  • 50
7
votes
1 answer

android ImageButton scale and maintain aspect ratio

I have a screen that I'm trying to layout... Basically, I'm trying to evenly distribute 4 ImageButton objects vertically on a screen... I used this here to evenly distribute the items, but now am having a terrible time getting the images to scale…
john ellis
  • 2,152
  • 2
  • 15
  • 13
7
votes
6 answers

OnClickListener cannot be resolved to a type (Eclipse)

Hello im new to programming, im trying to construct my first simple application, im looking to play a short soundclip on the push of an ImageButton. while typing out my code i get an error with the statement; Button.setOnClickListener(new…
Ben
  • 185
  • 1
  • 2
  • 8
7
votes
8 answers

Can I create an ASP.NET ImageButton that doesn't postback?

I'm trying to use the ImageButton control for client-side script execution only. I can specify the client-side script to execute using the OnClientClick property, but how do I stop it from trying to post every time the user clicks it? There is no…
Giffyguy
  • 20,378
  • 34
  • 97
  • 168
7
votes
2 answers

Creating a triangular shaped button for android application

I need to create 2 buttons arranged like this in my android application: But the problem is that the button I have created is not a perfect traingle shaped button. In fact it is a square button with the image set as background. Here in this case…
njnjnj
  • 978
  • 4
  • 23
  • 58
7
votes
1 answer

How can I make make a border for a clicked imagebutton in Android?

I am using Imagebuttons to show some icons in my android project.
user2426316
  • 7,131
  • 20
  • 52
  • 83
7
votes
5 answers

Set the text in ImageButton

I have a ImageButton which looks like this.
Suniel
  • 1,449
  • 8
  • 27
  • 39
7
votes
3 answers

Null Pointer Exception when setting LayoutParams

I created button in activity programmaticaly, not in xml file. Then I wanted to set it LayoutParams like in this link: How to programmatically set the layout_align_parent_right attribute of a Button in Relative Layout? But when I tried to launch, I…
Askar Zaitov
  • 283
  • 1
  • 6
  • 15
7
votes
4 answers

Android selector with image and text

I have a button which I give a color, image and text like this: android:background="@color/green" android:drawableLeft="@drawable/custom_routes_start_button_icon" android:text="@string/custom_route_start" This is the unselected state and want the…
Mark Molina
  • 5,057
  • 8
  • 41
  • 69
7
votes
1 answer

Android: How to avoid presses outside the circle of a round button using wrap content?

Can anyone tell me how to avoid presses outside the circle of a round button since "wrap_content" doesn't seem to work. I used an image file to create the button. I appreciate any help. Thanks.
7
votes
1 answer
7
votes
3 answers

how to change the image of a button with every click?

I created a button in the layout . In the Drawable folder I created a XML file named btn01_state. The btn01_state.xml is assigned to the button i created through "android:background=@drawable/btn01_state" Now, the button has a default image…
Androelpha
  • 387
  • 3
  • 8
  • 19