开发者

Using multiple fragments in each screen in ViewPager

开发者 https://www.devze.com 2023-04-01 10:06 出处:网络
I have been trying the ViewPager from recently supported android compatibility v4 package. In my app, I have multiple screens which I would like to swipe across

I have been trying the ViewPager from recently supported android compatibility v4 package.

In my app, I have multiple screens which I would like to swipe across just like what ViewPager does. But in my app, I have multiple fragments in EACH single screen. In the ViewPager, the FragmentPagerAdapter seems to be for the purpose of using multiple screens, each with single fragment.

I am wondering if there is anyway I could use the current support package for my current requirement? Or I need to go back to the same android launcher src to reference the home screen behavior an开发者_高级运维d design my own custom control.


PagerAdapters are a generic idea not strictly tied to fragments at all. FragmentPagerAdapter adds the association and rules for how a fragment maps to a page. You could write a similar adapter that presents multiple fragments per page and controls their layout within a container view.

0

精彩评论

暂无评论...
验证码 换一张
取 消