gpt4 book ai didi

react-native - 与PanResponder一起使用useNativeDriver

转载 作者:行者123 更新时间:2023-12-01 04:47:27 27 4
gpt4 key购买 nike

我试图将所有可能的东西移到useNativeDriver。我尝试了这个:

onPanResponderMove: Animated.event([null, { dy:this.state.appearAnim }], { useNativeDriver:true }),

但是,这会导致以下错误:

config.onPanResponderMove is not a function



如果我只是将 useNativeDriver设置为 false,那么它将按预期工作。
有谁知道如何在PanResponder中使用 native 驱动程序吗?

最佳答案

我引用了react-native github存储库中的内容:
PanResponder can't work with Animated.event([], {useNativeDriver: true});

This is a current limitation of native Animated.event. It doesn't work with PanResponder because it is implemented in JavaScript. You can have a look at https://github.com/wix/react-native-interactable which can handle gestures with native animated values.


看起来当前无法在react native中与PanResponder一起使用NativeDriver。

关于react-native - 与PanResponder一起使用useNativeDriver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45363416/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com