【发布时间】:2016-05-04 21:48:55
【问题描述】:
使用时出现此错误
getActivity().getSupportFragmentManager()
.beginTransaction()
.setCustomAnimations(
R.animator.card_flip_right_in, R.animator.card_flip_right_out,
R.animator.card_flip_left_in, R.animator.card_flip_left_out)
.replace(R.id.content_fragment, new DaysSinceBirthSettingFragment())
.addToBackStack(null)
.commit();
但是当我把它改成
getActivity().getFragmentManager()
.beginTransaction()
.setCustomAnimations(
R.animator.card_flip_right_in, R.animator.card_flip_right_out,
R.animator.card_flip_left_in, R.animator.card_flip_left_out)
.replace(R.id.content_fragment, new DaysSinceBirthSettingFragment())
.addToBackStack(null)
.commit();
完美运行。但是我需要支持旧版本,所以我必须使用getSupportFragmentManager()来自的support-v4。
我读到一些文章说res/animator 不受support-v4 支持,所以我也尝试将我的动画XML 文件移动到res/anim 文件夹并通过R.anim.card_flip_right_in 引用它
但还是不行,谁能告诉我该怎么办?
【问题讨论】:
标签: android animation android-support-library