赞
踩
1.添加依赖
compile 'me.yokeyword:fragmentation:最新版'
2.将rootFragment放入Activity中
loadRootFragment(id,fragment)
3.实现tab点击切换Fagment
loadMultipleFaragment(id,fragment ...)
4.显示和隐藏Fagment
showHideFragment(showFragment,hideFragment)
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)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。