I am a bit confused about MeasureSpec.UNSPECIFIED
and MeasureSpec.AT_MOST
.
I know that when match_parent
or an constant dimension value is set to layout_width
or layout_height
, MeasureSpec.EXACTLY
will be applied when measuring the view.
Then, how about MeasureSpec.UNSPECIFIED
and MeasureSpec.AT_MOST
?
My understanding is that, when layout_width
or layout_height
is set to wrap_content
, MeasureSpec.UNSPECIFIED
will be applied, because wrap_content
means the height or width of a view can be any size depending on the content. But many articles said that wrap_content
means MeasureSpec.AT_MOST
. So I am confused. I don't know when MeasureSpec.AT_MOST
should be applied.