When it's necessary to execute invalidate() on a View?

后端 未结 4 1888
予麋鹿
予麋鹿 2020-12-02 12:15

My answer to this question was just accepted but I started to wonder when exactly one needs to invalidate() a View and when it is not necessary?

After a bit of think

4条回答
  •  抹茶落季
    2020-12-02 12:56

    Please remember that drawing on the screen is frequent process, whenever you update a view, that change should be propogated and redrawn to notify such change right. invalidate() is a trigger method,that signals force reDrawing of any view you wish to show changes for.

提交回复
热议问题