我目前正在尝试使用 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 设置动画?
最佳答案
您应该能够简单地省略 create
和 delete
键:
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/