I have 11 Buttons with Background Images and if i switch to the actual RadioButton the circle thing on the RadioButton would show up and make my Background drawables ugly is there a way to make buttons work like RadioButtons?
I'm assuming the image changes when you click on the button to show it is selected. In that case, in your onclicklistener for the first button, you could change the image of that button to show it is selected, and also change the images of the other buttons to the unselected image. Do the same for each button.
Related
I want to have a image button with three possible states and depending on the logic display any one single image per state.
I could use a relative layout with three image buttons and toggle the visibility around.
But is there a way to define 3 states for an image button and toggle the images on a button level?
Thanks
use drawable selector drawable
Is there a way to create a RadioGroup consisting of a few RadioButtons, such that the look of each RadioButton is like an ordinary Button rather than the default look (a checked circle beside some text)?
Is it necessary to fall back on a LinearLayout of Buttons and manually change the background of the buttons when handling button presses in a listener?
Edit: To be concrete, say we have two RadioButtons, foo and bar. When one is pressed, the string is displayed in boldface. The small circles that are normally next to each RadioButton is omitted. Is it necessary to manually make the change from and to boldface?
You can always put a custom look for you radio buttons, such as adding android:background=#drawable... and then setting a custom image for checked and unchecked state.
I have an application in which you can accept friend request. For this purpose i have kept an activity which will start when an image button is pressed.
When my application starts i want to check if the user has any requests and if yes the button should be highlighted.
How do i do this?
Take another highlighted colour image. and Set TextView on that image.
Ex: RelativeLayout for that RelativeLayout background is your highlighted colour image then set TextView on that RelativeLayout.
Based on your condition put this image and number of pendings to TextView
you could make two imagebuttons. One which is in your normal colour and one in the highlighted colour, which are on the same place.
Depending on the situation you make either the one or the other (in-)visible.
how can i make it where a ImageView button when you click it, it will hide 2 pictures and a text box?
then when i click a different image view it will show them again
here's my code (not added any thing)
http://pastebin.com/XTrAy8sX
in the onClickListener for the ImageView, you can use setVisibility() to change the visibility of the other two views
I am trying to style my ListView with two 9-patch background images (16px * 9px), one dark image for default state and another green image for selected and pressed state.
It works except for just one problem that when I select or press one list item, it seems that the selected item overlap the next one a little bit as I can see some pixels of the green background image is on the top of next item.
How to fix that?
OK, I found I set a padding there...