自定义View View的测量是从子View开始的,具体代码顺序是:父容器的onMeasure方法会遍历到每一个子childView –>然后调用measureChild()方法 protected void measureChild(View child, int parentWidthMeasureSpec, int parentHeightMeasureSpec) { final LayoutParams lp = child.getLayoutParams(); final int childWidthMeasureSpec =