我试图制造一顿树脂(当压力时,会小得多)。 缩略语 页: 1
这是我迄今为止的法典:
import React, { useState } from react ;
import { View } from react-native ;
import Animated, { Easing, Extrapolate } from react-native-reanimated ;
import { TouchableWithoutFeedback } from react-native-gesture-handler ;
const { interpolate, sub } = Animated;
const TouchableResize = (props) => {
const { onPress, children } = props;
const [scale, setScale] = useState(0);
const scaling = interpolate(scale, {
inputRange: [0, 1],
outputRange: [1, 0.90],
extrapolate: Extrapolate.CLAMP
});
return (
<TouchableWithoutFeedback onPressIn={() => setScale(1)} onPressOut={() => setScale(0)}>
<Animated.View style={{ transform: [{ scaleX: scaling }, { scaleY: scaling }] }}>
{children}
</Animated.View>
</TouchableWithoutFeedback>
);
};
export { TouchableResize };
该法典有一部分工作。 纽特州在压力下转至0.90,但im灭不平。 它直飞到0.90,当它释放时, but子直接 s退。
How can I update my code so the animation runs smoothly? Please note I m a complete beginner in react-native-reanimated.