Article From:

Code address:…

I have a fragmentA, which is the structure of tabLayout+ViewPager+Fragment, and then I need to create a new set of types. The length is almost tabLayout+ViewPager+Fragment structure.I copied a fragmentB from the previous fragmentA and loaded it in the same way. Why is it white?

Code address:…

Answer 0:

That’s more accurate upstairs. It’s really a problem with getSupportFragmentManager (), but there’s no need to replace SlidingTabLayout.
mMyFragmentPagerAdapter = new MyFragmentPagerAdapter(getChildFragmentManager());
You can.
Do not use mTab.setViewPager (mViewPager, getTitles (), getActivity (), mFragmentLists).

Answer 1:

If you encounter a mistake, look at the error code first, and you usually have a wrong report.

Adapter is empty.

Answer 2:

useFragmentStatePagerAdapterWant a go

Answer 3:

Look at it. It feels like it’s used.SlidingTabLayout The problem is that the internal implementation of this control is used directlygetSupportFragmentManager() No usegetChildFragmentManager()

Why don’t you use TabLayout?


Should be the problem here, I made a submission after fork:…

Leave a Reply

Your email address will not be published. Required fields are marked *