apache 做网站,北京学生聚集,山东网站排行,彩票网站网站建设view 的 post 执行时#xff0c;首先会判断view 的 mAttatchInfo 是否为空#xff0c;如果不为空#xff0c;则将Runnable 添加到mAttachInfo.handler 的 UI线程MessageQueue 中#xff1b;如果为空#xff0c;则先将Runnable 暂存在view 的类为HandlerActionQueue的mRunQ…view 的 post 执行时首先会判断view 的 mAttatchInfo 是否为空如果不为空则将Runnable 添加到mAttachInfo.handler 的 UI线程MessageQueue 中如果为空则先将Runnable 暂存在view 的类为HandlerActionQueue的mRunQueue中在ViewRootImpl 中第一次执行performTransval时执行 dispatchAttachedToWindow 在这个方法中执行 mRunQueue.executeActions(mAttachInfo.handler)这样就能保证Runnable 运行时获取到获取到view的宽高因为这个时候首次performTransval已经执行完首次测量工也会执行完之后才会执行这个Runnable所以这个时候能获取到宽高