Can Any body let me know what is the unit of parameter of onMeasure(int widthMeasureSpec, int heightMeasureSpec) this View Class Method.
I print the log it return me 1073742144,-2147483251 respectively.
The value is a combination of mode and size. Use View.MeasureSpec.getMode(widthMeasureSpec)
to get the mode (one of MeasureSpec.EXACTLY
, MeasureSpec.AT_MOST
and MeasureSpec.UNSPECIFIED
); what you probably want to know is View.MeasureSpec.getSize(widthMeasureSpec)
, the size in pixels.
See also the source code of MeasureSpec.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With