首页 > 解决方案 > 在 ReactNative 中显示从 sqlite blob 加载的图像

问题描述

下面是我的实现

return (
  <View key={page.ItemID} collapsable={false}>
    <Image
      style={{ width: 100, height: 100 }}
      source={{uri: URL.createObjectURL(new Blob(blobData, {type: "image/png"}))}}
    />
    <Text>Test</Text>
  </View>
);

运行后出现错误npx react-native run-ios,详细在这里: undefined is not a function (near '...parts.map...')

标签: reactjsreact-native

解决方案


我请求,请检查您作为 uri 提供的值。你可以来知道是什么问题。

结帐下面的链接以获取您可以提供的 uri 的可能值。 https://reactnative.dev/docs/image#source


推荐阅读