Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Touch feedback for ImageButton (Android)

I'm developing an app for ICS. I like the way in which buttons in action bar feedbacks to user's touch (blue glow around), is there some simple way to add the same feedback for ImageButton?

Something like this, but with ImageButton: enter image description here

like image 346
user1049280 Avatar asked May 02 '26 12:05

user1049280


1 Answers

Yes, go into your SDK.

Navigate to Platforms->android-15->data->res

You are now in the res folder for the system. If you hunt in the drawable folder you should be able to find the xml selector that represents the default system button. That selector should make reference to some images that are stored in the other drawable folders. Pick a resolution and go into its folder and find all of the required images.

Once you've got all the required resources you can include them in your own project. Then use your own selector to show the alternate image when it is pressed.

Im not certain the effect you are after but I think if you set btn_default_holo_pressed.9.png as the background of an image view with an image in the src it should appear with the blue bar around the outside of it. With the selector you can make this happen during the press action.

like image 105
FoamyGuy Avatar answered May 05 '26 01:05

FoamyGuy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!