LayoutAnimation:如何不为输入视图设置动画?

时间:2017-01-16 14:08:35

标签: android ios react-native

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

LayoutAnimation.easeInEaseOut();

产生:
Video

如您所见,"过滤器"菜单动画通过淡入。我希望它不会淡入(从开始时出现在不透明度1)。

我尝试过:

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

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

1 个答案:

答案 0 :(得分:1)

您应该可以简单地省略createdelete键:

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

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