How to change selected background color of my image?
I want to change the selected background color of my image on touch开发者_StackOverflow中文版 event. Should i need to draw that image on canvas or it can be done by imageview only? Please help me
Have you tried
viewid.setBackgroundResource (somecolor)
to set the color?
http://developer.android.com/reference/android/view/View.html#setBackgroundResource(int)
To set the background color on a canvas, do something like this:
The first FF is the alpha value
Paint p=new Paint();
p.setColor(0xFFFFFFFF);
canvas.drawPaint(paint);
精彩评论