onMeasure()会调用measureVertical(int widthMeasureSpec, int heightMeasureSpec)

 mTotalLength保存已经measure过的child所占用的高度

void measureChildBeforeLayout(View child, int childIndex,

            int widthMeasureSpec, int totalWidth, int heightMeasureSpec,

            int totalHeight) //对每一个child进行测量, heightMeasureSpec为LinearLayout本身的measureSpec,totalHeight为

LinearLayout已经被其他子试图所占用的高度

 

measureChildWithMargins(View child,

            int parentWidthMeasureSpec, int widthUsed,

            int parentHeightMeasureSpec, int heightUsed) 

 

child.getMeasuredHeight()获取该子试图的最终高度 

 

ViewGroup.getChildMeasureSpec(int spec, int padding, int childDimension) 

View.resolveSizeAndState(int size, int measureSpec, int childMeasuredState)  

 

 

相关文章:

  • 2021-12-14
  • 2022-01-24
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-20
  • 2021-07-16
  • 2021-04-17
  • 2021-04-07
  • 2022-01-16
  • 2022-01-03
  • 2021-06-07
相关资源
相似解决方案