MagicMashRoom / SuperCalendar

@Deprecated android 自定义日历控件 支持左右无限滑动 周月切换 标记日期显示 自定义显示效果跳转到指定日期
2.76k stars 484 forks source link

RelativeLayout 执行measure方法异常 #85

Open nextmrwang opened 6 years ago

nextmrwang commented 6 years ago

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 commented 6 years ago

Api17及以下会出现NullPointerException

CoolJie2001 commented 6 years ago

Api18也一样会出现NullPointerException