【发布时间】:2020-06-09 06:56:32
【问题描述】:
const valueX = useRef(new Animated.Value(0)).current
useEffect(() => {
Animated.timing( valueX , {
toValue : // How to get the original X position of the component here.
duration : 1000,
easing : Easing.linear
}).start()
}, [])
所以,我最初在屏幕上的某个位置有一个组件(即视图)。我想在那里使用反应原生动画 API 制作一个轻微的动画。我想要的是 将该视图的 X 位置从 0 移动到其原始位置 。如何做呢?
【问题讨论】:
标签: react-native use-effect react-animated react-animations