react-native - React Native - 模式中未指定“useNativeDriver”
问题描述
我正在构建一个使用库react-native-image-viewer显示可缩放图像的模式。这是我的自定义组件:
<Modal
animationType="slide"
visible={isVisible}
transparent={true}
>
<ImageViewer imageUrls={images} />
</Modal>
问题是,当我单击图像时,会显示模态并显示可缩放图像,但会显示以下警告消息:
动画:
useNativeDriver
未指定。这是一个必需选项,必须明确设置为true
或false
我一直在搜索很多,解决方案找到了在哪里包含这样的内容:
animatedValue = new Animated.Value(-300);
componentDidMount() {
Animated.timing(this.animatedValue,
{
toValue: 0,
duration: 3000,
useAnimatedDriver: true,
}).start();
}
并将ImageViewer包含在 Animated.View 组件中,但我已经尝试过了,我仍然有同样的警告。有什么解决办法吗?提前致谢
解决方案
推荐阅读
- android - 使用 FFmpeg 将 JPEG 转换为 GIF 时的质量问题
- getusermedia - 什么决定了 MediaStreamTrack.getCapabilities() 方法枚举了哪些功能?
- r - 在 R 中将 87x2 矩阵转换为 29x6
- java - 将变量从一个类传递到另一个类
- javascript - FlowJS - 数字......与字符串不兼容
- reactjs - 为什么我们不需要在 React 中绑定箭头函数?
- bash - docker run 不在 /etc/profile.d/ 中运行我的脚本
- r - R中的面板数据处理
- xamarin - 在 Xamarin 中捕获后显示图像
- c# - “找不到编码 1252 的数据” iTextSharp 使用日文字体