Animation 反应:弹簧速度
我正在研究UI/UX的Animation 反应:弹簧速度,animation,react-native,Animation,React Native,我正在研究UI/UX的动画库功能,我正在尝试设置动画序列的速度 按下屏幕上的项目时会发生以下情况。它“弹出”该项目。这会在几秒钟内发生,但我想加快这个过程。我想我可以在并行操作中添加一个动画。计时…,但我没有成功:/ Animated.parallel([ Animated.sequence([ Animated.spring( this.state.enter, { toValue: 0.9, tension:40, friction: 2
动画
库功能,我正在尝试设置动画序列的速度
按下屏幕上的项目时会发生以下情况。它“弹出”该项目。这会在几秒钟内发生,但我想加快这个过程。我想我可以在并行操作中添加一个动画。计时…
,但我没有成功:/
Animated.parallel([
Animated.sequence([
Animated.spring(
this.state.enter,
{ toValue: 0.9, tension:40, friction: 2 }
),
Animated.spring(
this.state.enter,
{ toValue: 1, tension: 40, friction: 10 }
)
])
]).start();
您只需知道
此.state.enter
=新建动画.Value(0.1)
Facebook在官方文档中声明,在使用Animated.spring时,您必须在两对参数之间进行选择:
1) 反弹和速度(默认值为8和12)
或
2) 张力和摩擦力(默认值为40和7)
因此,如果你想加快这一过程,最好的选择是发挥弹性和速度
从文档:
var springConfig;
if (config.bounciness !== undefined || config.speed !== undefined) {
invariant(
config.tension === undefined && config.friction === undefined,
'You can only define bounciness/speed or tension/friction but not both',
此处的更多信息:张力不控制速度吗?->来自docs:spring:匹配折纸的简单单弹簧物理模型。摩擦:控制“反弹”/“超调”。默认7。张力:控制速度。默认值40。@NaderDabit我确实看到了,但速度似乎没有受到我所做更改的显著影响。我将再次访问。谢谢