Disappear SmartTabLayout pageViewer content

前端 未结 1 358
情话喂你
情话喂你 2021-01-27 05:51

I\'m trying to use SmartTabLayout from here https://github.com/ogaclejapan/SmartTabLayout, and i have a drawer. When i\'m clicking at item on drawer, i replace my fragment, to f

相关标签:
1条回答
  • 2021-01-27 06:14

    Notes: If using fragment inside a ViewPager, Must be use Fragment#getChildFragmentManager().

    https://github.com/ogaclejapan/SmartTabLayout#pageradapter-for-fragment-based-page

    FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(
                getChildFragmentManager(), FragmentPagerItems.with(this.getA())
                .add(R.string.item_pager_title_products, ProductListFragment.class)
                .add(R.string.item_pager_title_shops, ShopListFragment.class)
                .create());
    

    FYI: Had same problem because I didn't read the manual... Original answer found here https://stackoverflow.com/a/25525714/1257369

    0 讨论(0)
提交回复
热议问题