Closed SteveZhao1994 closed 6 years ago
i find the answer
change the line heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
to if(height == 0) { heightMeasureSpec = MeasureSpec.makeMeasureSpec(300, MeasureSpec.EXACTLY); } else { heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY); }
in onMeasure() method of CustomViewPager.java class
i find the answer
change the line heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
to if(height == 0) { heightMeasureSpec = MeasureSpec.makeMeasureSpec(300, MeasureSpec.EXACTLY); } else { heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY); }
in onMeasure() method of CustomViewPager.java class