获取自定义view属性的时候 遇到这个问题
int[] arr = new int[] { android.R.attr.layout_width, android.R.attr.layout_height };
TypedArray typedArray = context.obtainStyledAttributes(attrs, arr);
typedArray.getDimensionPixelSize(1, ViewGroup.LayoutParams.MATCH_PARENT);
如果 android:layout_height="match_parent"
typedArray.getDimensionPixelSize(1, ViewGroup.LayoutParams.MATCH_PARENT);
这行代码执行的时候会报异常
java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x10
搞了好久才搞明白0x10的含义
/**
* Container for a dynamically typed data value. Primarily used with
* {@link android.content.res.Resources} for holding resource values.
*/
public class TypedValue {
/** Identifies the start of plain integer values. Any type value
* from this to {@link #TYPE_L