Android: how to draw ImageButton as pressed until it loses focus?
Once pressed, I would like an ImageButton to continue to draw as if it was pressed until something else is touched. Is there a way to do this short of ex开发者_C百科tending the ImageButton to control how it is drawn, and adding a focus listener to monitor if it loses focus?
Thanks you.
You can use selectors objects instead of bitmaps to give the desired effect in image buttons
More on this here http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList
精彩评论