Caleb Bramwell
Caleb Bramwell

Reputation: 1342

Android Canvas rectangle change color

I have a custom view with a rectangle:

mCanvas.drawRect(0, 0, 50, 50, paint);

I want to change the fill of the rectangle based on touch input.

How do I change the paint after the rectangle has been drawn?

Upvotes: 1

Views: 842

Answers (1)

Ian Markowitz
Ian Markowitz

Reputation: 265

You can't change the paint like that. You need to redraw the rectangle.

Upvotes: 1

Related Questions