android - 布局动画 : how to not animate entering views?

标签 android ios react-native

我目前正在尝试使用 LayoutAnimation 为 View 更改设置动画。 使用此代码:

LayoutAnimation.easeInEaseOut();

产出:
Video

如您所见,“过滤器”菜单通过淡入进行动画处理。我希望它不淡入(从一开始就以不透明度 1 显示)。

我试过:

LayoutAnimation.configureNext({
  duration: 200,
  create: {
    type: 'easeInEaseOut',
  },
  delete: {
    type: 'easeInEaseOut',
  },
  update: {
    type: 'easeInEaseOut',
  },
});

但我收到错误:Unsupported layout animation createConfig property (null)。是否可以不使用 LayoutAnimation 为创建的 View 设置动画?

最佳答案

您应该能够简单地省略 createdelete 键:

  LayoutAnimation.configureNext({
    duration: 200,
    update: {
      type: 'easeInEaseOut'
    }
  });

错误 Unsupported layout animation createConfig property (null) 是由创建/删除动画中缺少名为 property 的必需值引起的。

关于android - 布局动画 : how to not animate entering views?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41678278/

相关文章:

java - 在 Android 中使用定时器启用和禁用按钮

android - 如何将 TextView 对齐到 ImageView 的右侧

Android:如何区分清除通知栏中的所有事件和用户操作

ios - 如何从 View Controller 的 subview 的自定义类中调用 performSegueWithIdentifier?

ios - 在 uitableviewcell 中切换复选框图像

react-native:无法更新 View 标记 35 的属性

android - 简单的 TextView.setText 导致 40% 的 CPU 使用率

ios - ViewModel 类能否按照 MVVM 符合 iOS 中的 UITableviewDelegate 和 UITableViewDataSource

ios - 基于环境 fork jsCodeLocation的最佳实践

react-native - React Native 导航和错误边界