以下代码也适用于进入动画和退出动画,我不希望它在退出时设置动画。我在这里做错了什么。?
MyProfileFragment profileFragment = new MyProfileFragment();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.content_frame, profileFragment);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
profileFragment.setEnterTransition(new Fade().setDuration(200));
//profileFragment.setExitTransition(new Fade().setDuration(0));
}
ft.addToBackStack("profile");
ft.commit();