Open Sogrey opened 5 years ago
View.invalidate(): 层层上传到父级,直到传递到ViewRootImpl后触发了scheduleTraversals(),然后整个View树开始重新按照View绘制流程进行重绘任务。
invalidate:在ui线程刷新view postInvalidate:在工作线程刷新view(底层还是handler)其实它的原理就是invalidate+handler
View.postInvalidate最终会调用ViewRootImpl.dispatchInvalidateDelayed()方法
View.invalidate(): 层层上传到父级,直到传递到ViewRootImpl后触发了scheduleTraversals(),然后整个View树开始重新按照View绘制流程进行重绘任务。
invalidate:在ui线程刷新view postInvalidate:在工作线程刷新view(底层还是handler)其实它的原理就是invalidate+handler
View.postInvalidate最终会调用ViewRootImpl.dispatchInvalidateDelayed()方法