开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜