SuperCalendar
SuperCalendar copied to clipboard
RelativeLayout 执行measure方法异常
private void setupLayoutResource(int layoutResource) { View inflated = LayoutInflater.from(getContext()).inflate(layoutResource, this); //====================================== inflated.setLayoutParams(new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT)); //====================================== inflated.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); inflated.layout(0, 0, getMeasuredWidth(), getMeasuredHeight()); }
Api17及以下会出现NullPointerException
Api18也一样会出现NullPointerException