如何获得两个动画组件之间的距离?

问题描述

如果我有两个动画组件在一个视图中使用具有各种动画时间作为函数的变换移动,那么我如何计算它们之间的距离?

例如


const valueOne = new Animated.Value(0)[0]
const valueTwo = new Animated.Value(0)[0]

const example = () => {
    <View>
        <Animated.View style={.[
                                {
                                    transform: [
                                        {
                                          translateX: valueOne,},],}
                              ]} >
            <Text>I'm on the left side of the screen</Text>
        </Animated.View>
        <Animated.View style={[
                                {
                                    transform: [
                                        {
                                          translateX: valueTwo,}
                              ]} >
            <Text>I'm on the right side of the screen</Text>
        </Animated.View>
    </View>
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)