TianTingting
TianTingting
如果是FragmentManager 管理 Fragment中嵌套的是ViewPager 嵌套 Fragment时,该方法适用吗?
用这个方式向Activity加入Fragment,并进行展示, FragmentTransaction trx = getSupportFragmentManager().beginTransaction(); if (currentTabIndex != index) { initColorAndPicture(); changColorAndPicture(); if (currentTabIndex != -1) { trx.hide(fragments[currentTabIndex]); } if (!fragments[index].isAdded()) { trx.add(R.id.parent_fl_content, fragments[index]); } trx.show(fragments[index]).commit(); currentTabIndex = index; }...
用这个方式向Activity加入Fragment,并进行展示, FragmentTransaction trx = getSupportFragmentManager().beginTransaction(); if (currentTabIndex != index) { initColorAndPicture(); changColorAndPicture(); if (currentTabIndex != -1) { trx.hide(fragments[currentTabIndex]); } if (!fragments[index].isAdded()) { trx.add(R.id.parent_fl_content, fragments[index]); } trx.show(fragments[index]).commit(); currentTabIndex = index; }...