本机动画模块不支持React Native 0.63.2样式属性'width'

时间:2020-08-12 12:24:55

标签: react-native react-native-reanimated

我想更改Animated.View宽度,但出现此错误。我不想使用NativeDriver。我添加了“ useNativeDriver:false”,但是一切都一样。我该怎么办?

const show = () => {
    console.log("show");
    Animated.timing(mode, {
        toValue: 1,
        duration: 500,
        useNativeDriver:false,
    }).start();
};

const hide = () => {
    Keyboard.dismiss();
    Animated.timing(mode, {
        toValue: 0,
        duration: 500,
        useNativeDriver:false,
    }).start();
};

const inputSize = mode.interpolate({
    inputRange:[0, 1],
    outputRange:["100%", "80%"]
});
       



 <Animated.View style={[styles.searchContainer, {width:inputSize}]}>
        <EvilIcons name="search" size={wp("8%")} color="rgba(0,0,0,.6)"/>
        <TextInput 
        placeholder={`${i18n.t("search")}`}
        onChangeText={(text)=>setValue(text)}
        value={value}
        returnKeyType="go"
        style={styles.input}
        onFocus={()=> show()}
        />
 </Animated.View>

0 个答案:

没有答案