bukeLiu

Results 1 comments of bukeLiu

这样写一般是在 Activity 的 onResume 方法中,因为 onResume 执行在 View 初始化之前,如果在 onResume 中直接获取 View 宽高是获取不到的。使用 view.post 就能获取到,因为 view.post 是向 主 Handler 的 MessageQueu 中插入一条带执行消息,但是因为系统在 ViewRoot 中初始化 View 时也是利用 Handler 机制,平且为了优先执行 View 的初始化设置了同步屏障,导致...