片段内的ViewPager

时间:2013-12-05 08:25:10

标签: android android-viewpager fragment

是否有可能在ViewPagerFragment内膨胀Activity?几乎所有在ViewPager内找到FragmentActivity并且我不想使用FragmentActivity(由于某种原因)的示例。它将看起来像这张照片:

enter image description here

请帮帮我,谢谢:)

1 个答案:

答案 0 :(得分:0)

是的,这是可能的,但您必须记住片段内部使用的FragmentManager来管理子片段(例如,在其构造函数中提供给FragmentPagerAdapter的片段)是使用getChildFragmentManager和NOT {{ 1}}。这非常重要,如果你不这样做,你的应用程序就会崩溃。

查看this tutorial示例实现。

相关问题