Change Fragment with ViewPager

后端 未结 2 1180
旧巷少年郎
旧巷少年郎 2021-01-25 04:43

I am using PagerSlidingTab Library for ViewPager. And I want to change Fragment while scrolling of tabs. It is working fine. Check out my code.

2条回答
  •  暖寄归人
    2021-01-25 05:27

    please use this example..its very easy.i already implement that.

    reference link

    hope its useful to you.its best example of pager-sliding-tabstrip.

    Use

    framelayout compulsory:
    FrameLayout fl = new FrameLayout(getActivity());
            fl.addView(urFragementView);
    

    and then set your fragement view in this framelayout.

提交回复
热议问题