private ConstraintLayout constraintLayout;
constraintLayout=findViewById(R.id.screen_test);
constraintLayout.measure(0,0);
Log.i(TAG,"onCreate:"+constraintLayout.getMeasuredHeight()+","+constraintLayout.getMeasuredWidth());
0所对应的 MeasureSpec
现在知道了传递的0并不是简单的一个0,它符合着 MeasureSpec 规范。
将0解包后,所对应的 SpecMode = 0,SpecSize = 0.
SpecMode 0 对应的模式为 UNSPECIFIED.
UNSPECIFIED的官方解释:
The parent has not imposed any constraint on the child. It can be whatever size it wants.
父容器不会对子元素加以任何约束,子元素可以是任何大小。