1, ViewportWidth是vector图片的画布,相当于vector内容外面的盒子。如果ViewportWidth跟vector里面的width不一致,ViewportWidth也会影响最终的显示尺寸。如果当imageView的width,假设为widthM小于ViewportWidth, vector的内容会被scale,相当于width * (widthM/ViewportWidth).
2, MeasuredWidth 是本身的尺寸,layout的里面的width才是最终显示的尺寸。比如下面的代码:
ic_ball.xml
ImageView的meansure尺寸,永远等于24dp,无论如何改变layout_width的大小,因为layout_width是layout的约束,不是view自身的大小。
The size of a view is expressed with a width and a height. A view actually possess two pairs of width and height values.
The first pair is known as measured width and measured height. These dimensions define how big a view wants to be within its parent (see Layout for more details.) The measured dimensions can be obtained by calling getMeasuredWidth() and getMeasuredHeight().
The second pair is simply known as width and height, or sometimes drawing width and drawing height. These dimensions define the actual size of the view on screen, at drawing time and after layout. These values may, but do not have to, be different from the measured width and height. The width and height can be obtained by calling getWidth() and getHeight().