Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 从Animated.interpolate响应本机重新激活的输出值_Reactjs_React Native_React Native Reanimated_React Native Gesture Handler - Fatal编程技术网

Reactjs 从Animated.interpolate响应本机重新激活的输出值

Reactjs 从Animated.interpolate响应本机重新激活的输出值,reactjs,react-native,react-native-reanimated,react-native-gesture-handler,Reactjs,React Native,React Native Reanimated,React Native Gesture Handler,我懂动画。代码 我在每一帧中都会看到console.log 我想知道Animated.interpolate的输出电流值 代码片段 const diffClampScrollY = Animated.diffClamp(this.props.Animation_Header_Heaght, 0, HEADER_HEIGHT) const headerY = Animated.interpolate(diffClampScrollY, { inputRange: [0,

我懂动画。代码 我在每一帧中都会看到console.log

我想知道Animated.interpolate的输出电流值

代码片段

 const diffClampScrollY = Animated.diffClamp(this.props.Animation_Header_Heaght, 0, HEADER_HEIGHT)

    const headerY = Animated.interpolate(diffClampScrollY, {
        inputRange: [0, HEADER_HEIGHT],
        outputRange: [0, -HEADER_HEIGHT],
    })
render(){
   return(
    <Animated.Code>
       {() =>
         call([headerY], () => {
         console.log(headerY)
       })
    </Animated.Code>
  )
 }
我不明白这件事的来龙去脉


我想知道单个当前值?

将其放入动画.Code块中

{=>debug'headerY:',headerY}


原因是headerY是一个节点,因此您不能只记录它。必须使用特制的日志节点来记录节点值。

将其放入动画.Code块中

{=>debug'headerY:',headerY}

原因是headerY是一个节点,因此您不能只记录它。您必须使用特制的日志节点来记录节点值。

调用argsNodes,根据重新激活的回调,如果argsNodes数组中的一个节点更新,将在JavaScript中调用回调,并将argsNodes数组中节点的当前值列表作为第一个参数。 要控制台headerY的值,需要将其作为回调函数的参数传递,以如下方式访问它:

  ...
    <Animated.Code>
       {() =>
         call([headerY], ([headerY]) => {
         console.log(headerY)
       })
    </Animated.Code>
callargsNodes,根据重新激活的回调,如果argsNodes数组中的一个节点更新,将在JavaScript中调用回调,并将argsNodes数组中节点的当前值列表作为第一个参数。 要控制台headerY的值,需要将其作为回调函数的参数传递,以如下方式访问它:

  ...
    <Animated.Code>
       {() =>
         call([headerY], ([headerY]) => {
         console.log(headerY)
       })
    </Animated.Code>

您是否尝试过调试节点?您是否尝试过调试节点?使用debug时,我的应用程序被压碎并显示此消息=>预期“exec”道具或子项为动画节点或返回动画节点的函数。已将对象类型传递给childrenI我现在无法测试任何内容,但只是想一想,您是否尝试过仅将console.log替换为debug'headerY:',headerY?因此,您保留调用和所有使用的调试时,我的应用程序被粉碎,并给我此消息=>期望“exec”道具或子对象是动画节点或返回动画节点的函数。已将对象类型传递给childrenI我现在无法测试任何内容,但只是想一想,您是否尝试过仅将console.log替换为debug'headerY:',headerY?所以你保留电话和一切