1.4.Invalidate和postInvalidate
API的描述:Invalidate the whole view. If the view is visible, onDraw(Canvas) will be called at somepoint in the future. This must be called from a UI thread. To call from anon-UI thread, call postInvalidate()。
即,在UI线程的话可以直接调用invalidate去刷新布局,其他的非UI线程的话要去调用postInvalidete()。
Invalidate和postInvalidate
最新推荐文章于 2024-07-14 07:43:57 发布