Calling onDraw() method of a custom View in Android

前端 未结 1 678
没有蜡笔的小新
没有蜡笔的小新 2021-02-07 14:44

I have created a CustomView for Calendar. I have an onDraw method to draw the text in the calendar. I want to change the color of the day Text when i click on it. How can i achi

1条回答
  •  长情又很酷
    2021-02-07 14:56

    Call mView.invalidate(); in your onClick() method for that View. This will call onDraw() (eventually), which will then run the drawing code for your view.

    0 讨论(0)
提交回复
热议问题