【发布时间】:2023-04-10 05:26:01
【问题描述】:
.setCustomAnimations(R.animator.in_animation, R.animator.out_animation) 以下抛出“预期资源类型的动画”
getSupportFragmentManager()
.beginTransaction()
.setCustomAnimations(R.animator.in_animation, R.animator.out_animation)
.replace(R.id.a_fragment, SingleAnswerFragment.newInstance())
.addToBackStack(null)
.commit();
我确实在流线程Android Studio's "expected resource of type" checks? 上检查了这个堆栈,我确实看到了在这种情况下我可以在哪里使用@Animator Res 注释,但我不确定如何在我的方法链接中间使用它,如图所示以上
https://stackoverflow.com/a/18511350/5596604 在这里我看到了一个可能的解决方案,但不知道他在他的步骤中意味着什么,(将 NineOldAndroids 库导入 support-v4 库 将 support-v4-nineoldandroids 库导入到我的项目中。) NineOldAndroids 支持库的 github 链接在配置部分中声明“从类路径中删除 Google 的支持 v4 库”。
【问题讨论】:
-
OP 我觉得你对此感到痛苦,这是谷歌提供给我们的一个非常迟钝的错误。
-
在我升级之前它运行良好。