我有一个 ViewPager 包含三个片段,我想将 3 个新片段放入第三个片段中.可以吗?
I have a ViewPager contains three fragment, and I want to put 3 new fragments into the third fragment.Is that possible?
[ViewPager]
[Fragment 1]
[Fragment 2]
[Fragment 3]
[Fragment 3-1]
[Fragment 3-2]
[Fragment 3-3]
[ViewPager]
我不能 getChildFragmentManager() 但只能 getFragmentManager(),我正在使用 android.support.v4.app:
I can't getChildFragmentManager() but only getFragmentManager(), I'm using android.support.v4.app:
FragmentManager fm = getFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.add(R.layout.tools_frame5, new Plugins());
ft.commit();
将 3 个活动放在第三个片段中怎么样,这可能吗?
what about Putting 3 Activities in the third Fragment, Is that possible?
是的,可以嵌套片段.
在处理嵌套片段时,您必须使用 getChildFragmentManager() 而不是 getFragmentManager().有关详细信息,请查看 此链接.
You have to use getChildFragmentManager() instead of getFragmentManager() while you are working with nested fragments. For more details look into this link.
希望这会对你有所帮助....:)
Hope this will help you....:)
这篇关于嵌套片段可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!