SuperCalendar icon indicating copy to clipboard operation
SuperCalendar copied to clipboard

RelativeLayout 执行measure方法异常

Open nextmrwang opened this issue 7 years ago • 2 comments

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()); }

nextmrwang avatar Nov 10 '17 07:11 nextmrwang

Api17及以下会出现NullPointerException

nextmrwang avatar Nov 10 '17 07:11 nextmrwang

Api18也一样会出现NullPointerException

CoolJie2001 avatar Nov 10 '17 07:11 CoolJie2001