我正在用片段 B 替换片段 A 并对其进行动画处理。片段 B 具有RelativeLayout
aTextView
和 a ListView
。我可以看到片段 B 中的视图是单独动画的,TextView
幻灯片的速度与列表项 1 的副标题不同,而列表项 1 的标题和图标立即出现而没有动画,我希望整个视图动画同时,这有可能实现吗?
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
Fragment existing = fragmentManager.findFragmentById(R.id.welcome_content);
if (existing != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
fragmentToLoad.setAllowEnterTransitionOverlap(true);
fragmentToLoad.setEnterTransition(new Slide(Gravity.RIGHT));
}
fragmentTransaction.remove(existing);
}
fragmentTransaction.add(R.id.welcome_content, fragmentToLoad);
fragmentTransaction.commitNow();