Android. Tablayout inside a tab of another tablayout

后端 未结 3 1193
有刺的猬
有刺的猬 2021-01-06 08:30

Is it possible to have a tablayout inside a tab of another tablayout? I have created the following image for a better explanation. The slide movement desired is as it is des

3条回答
  •  甜味超标
    2021-01-06 08:49

    Simple

    Everything will remain same like you set ViewPager in Activity. Just you need to use getChildFragmentManager() in Fragment instead of getFragmentManager().

    From getChildFragmentManager() documentation

    Return a private FragmentManager for placing and managing Fragments inside of this Fragment.

    From getFragmentManager() documentation

    Return the FragmentManager for interacting with fragments associated with this fragment's activity.

    You can see @this answer for complete code.

提交回复
热议问题