I made a ScrollView containing a ViewPager, but the ViewPager does not grow in height. When the content inside the ViewPager is too big, it get \'pucht\'(?) inside, the tabl
If these answer still can't fix the problem, I can provide another choice.
At the PagerAdapter
java file, you can measure the page
height manually and set the container's LayoutParams.height
in instantiateItem
method. Like this:
@Override
public Object instantiateItem(@NonNull ViewGroup container, int position) {
View view = generateView(mContext, position);
view.measure(View.MeasureSpec.makeMeasureSpec(DensityUtil.getScreenWidth(mContext), View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
container.getLayoutParams().height = view.getMeasuredHeight();
container.addView(view);
return view;
}