Android fragment退出view时,怎么设置它的退出动画?求救...
发布网友
发布时间:2022-05-13 17:19
我来回答
共1个回答
热心网友
时间:2023-10-17 18:15
FragmentTransaction ft = getFragmentManager().beginTransaction();
//设置进入退出动画
ft.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_right);
DetailsFragment newFragment = DetailsFragment.newInstance();
ft.replace(R.id.details_fragment_container, newFragment, "detailFragment");
// Start the animated transition.
ft.commit();