Fagmentation使用流程

gihub的连接

实现微信切换界面:

1.添加依赖

compile 'me.yokeyword:fragmentation:最新版'

2.将rootFragment放入Activity中

loadRootFragment(id,fragment)

3.实现tab点击切换Fagment
loadMultipleFaragment(id,fragment ...)

4.显示和隐藏Fagment

showHideFragment(showFragment,hideFragment)

时间可滑动切换Fragment:

1.添加依赖

compile 'me.yokeyword:fragmentation:最新版'

2.将rootFragment放入Activity中

loadRootFragment(id,fragment) 在Fagment布局中添加Viewpager和tablayout

3.编写FragmentPagerAdapter
返回fragment和标题

4.将viewpager和tablayout,fargmentpageradapter相关联

viewPager.setAdapter(new FargmentPagerAdapter(getChildFragmentManager(),String titles))

tablayout.setupWithViewPager(viewPager)

你可能感兴趣的:(Fagmentation使用流程)