imagebutton

Android crashes when calling ImageButton

I have a crash (Application Stopped Unexpectedly) problem with this main.xml is a "HelloWorld" type project (while testing and learning features I need for my app) : I isolated the ImageButton as an issue, but I can't isolate any of the parameters... <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:...

Problem with ImageButton.setVisibility()

Hello guys! I'm having a problem when setting the visibility of two image buttons one on top of the other. The idea is to implement a play/pause control. The problem is that the only part where setting the visibility actually works is in the click listeners of the buttons. If I try to change it somewhere else nothing happens. Any idea w...

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 reason to post when this button is clicked. I've set CausesValidation to False, but this doe...

Android Image Button Problem

Hi, i have the following imageButton <ImageButton android:id="@+id/header_buttonleft" android:layout_width="40dip" android:layout_height="40dip" android:layout_alignParentLeft="true" android:layout_marginLeft="10dip" android:layout_marginTop="5dip" android:src="@drawable/icon_download" android:clicka...

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 into my res folder, but when I set it as the background, it becomes blurry (since the origi...

Uniquely Identify ImageButtons placed Programmatically

Hi, I have been placing several ImageButtons programmatically in a TableLayout, every ImageButton has it's own Drawable resource as a Background. I use an XML description for the layout of the ImageButton itself and afterwards use the LayoutInflater to retrieve such an ImageButton (called genre_cell.xml): <?xml version="1.0" encoding="u...

how to display the text on ImageButton.

how to display the text on ImageButton. or how to have a linkbutton on Image I have tried this: <asp:LinkButton ID="lbYear" runat="server" CausesValidation="false" Text="HOME"> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/menu.png" Width="90px" Height="39px" /> </asp:LinkButton> but it is showing the text above the ...

Android ImageButton from url

Can I set an ImageButton's image from an http URL? Thanks Chris ...

Changing button image based on user input

I want to have a button on my main screen (button1). When button1 is pressed, it takes me to a 2nd screen with multiple buttons. (this part is done). When a user presses a button on that screen, it goes back to the main screen and changes that button to the same image as the button they pressed. Example MAIN -speed_ability_button (set ...

Android - Overlay ImageButton by TextView on xml layout

Hi! I'm looking for how to overlay an ImageButton by a TextView in android xml layout. For the moment when I reduce the the TextView margin top, the TextView is going under the ImageButton. I want the contrary. ...

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: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; <!-- pressed --> <item ...

background color in a ImageButton

I put a background color in a ImageButton? How? ...

disable an ImageButton?

wanted to leave a ImageButton is disabled (not clickable), but have used android: enabled = "false" but does not work Does anyone know how to disable an ImageButton? ...

Android highlight ImageButton onclick

Is there a way to highlight an ImageButton when it's pressed? ...

Android ImageButton selector - one xml per button?

When using the "selector" to specify different images for buttons for different states, such as pressed, focused etc, do I have to write an xml file for each button? I have about 15-20 buttons in my app, so was wondering if there is a way to write just one xml and refer to parts of it? Thanks Chris ...

Android ImageButton - determine what resource is currently set

Is there a way I can find what resource a particular ImageButton is set to, at any given time? For eg: I have an ImageButton that I set to R.drawable.btn_on onCreate. Later, at some point, the ImageButton gets set to R.drawable.btn_off. I want to be able to check what resource the ImageButton is set to in my code. Thanks Chris ...

Android ImageButton setImageResource from variable

I want to setImageResource for an ImageButton programatically, based on a variable. For eg: if size=5, I want to setImageResource to R.drawable.five if size=6, I want to setImageResource to R.drawable.six Unfortunately, I have too many of these, so an if-else or switch gets tiring. Is there a way to achieve something like: R.dr...

Android ImageButton with Image and Text

I want to have a button that has an image on top and some text on bottom. Both the image and text are decided during runtime, so I want to be able to combine ImageButton's setImageBitmap and Button's setText for each button. Any ideas? Thanks Chris ...

Android ImageButton border?

I have a series of ImageButtons horizontally laid out in a LinearLayout. When I do a setBackgroundColor to GREEN, these ImageButtons all become GREEN rectangles, all connected that look like one single bar. Is there a way I can specify a border between these buttons, so I know where one button starts and where it ends? ...

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 not in the remoteview. How could I implement this functionality in the home screen widg...