android - fragment 事务中 2 个 View 的动画

标签 android android-fragments android-animation

getFragmentManager().beginTransaction().setCustomAnimations(
  R.animator.1, R.animator.2,R.animator.3, R.animator.4)
  .replace(view1, view2)
  .addToBackStack(null)
  .commit();

这只会在 view2 上执行动画。我还想同时对 view1 做一些事情。我怎样才能做到这一点?这些 View 是具有动态生成的 id 的 FrameLayouts

最佳答案

引用安卓开发者: FragmentTransaction setCustomAnimations(int enter, int exit, int popEnter, int popExit)

如果我清楚地了解您的需求,要为 1 个 View 使用动画,您必须为退出参数提供动画器

关于android - fragment 事务中 2 个 View 的动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31498549/

相关文章:

java - Android 抽屉导航从服务器获取数据

android - 如何更改primary和primaryDark颜色?

android - onItemClickListener 在 GridView 中没有响应

android - PlayStore新视差效果怎么做

android - Resources$NotFoundException 当资源存在时

android - BroadcastReceiver 为一个事件接收多个相同的消息

android - 在android中的更改 Activity 上滑动xml动画

android - 为什么退出动画在通过点击工具栏/应用栏左上角的后退箭头退出 Activity 时不起作用?

java - Appcelerator Titanium 移动和 Airpush

android - DexGuard:如何指定字符串加密