OnDraw is not called.

Asked 2 years ago, Updated 2 years ago, 23 views

Draw something first on the onDraw of a customized view

If I say setBackGroundResource(), onDraw doesn't work So I can't update my screen...

What should I do?

android

2022-09-22 12:56

1 Answers

If the purpose is to call the onDraw() function, call the invalidate() function of the View class. For a detailed description of the function, search for the link below and related keywords.

https://developer.android.com/reference/android/view/View.html#invalidate()


2022-09-22 12:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.