在IOS中使用React native这个代码。
<ImageBackground
style={styles.item}
source={{ uri: item.uri }} >
{selected && selectedItemCount.lenght > 0 &&
<View style={{ ...styles.countBadge, backgroundColor: badgeColor }}>
<Text style={styles.countBadgeText}>{selectedItemCount}</Text>
</View>
}
</ImageBackground>
item.uri是:assets-library:/assetasset.PNG?id=8602ACD9-04C2-4FA9-B8A1-F65E1C1299DD&ext=PNG。
它在andriod工作,但IOS会出现这个错误。
[tid:com.facebook.react.ImageLoaderURLRequestQueue][RCTImageLoader.mm:510] 没有找到合适的图片URL加载器,用于assets-library:/assetasset.PNG?id=8602ACD9-04C2-4FA9-B8A1-F65E1C1299DD&ext=PNG 2020-06-08 23:16:28.129。
react版本:"react-native": "~0.61.5",xcode版本:11.4.1。
所以他们似乎把assets-library:/asset改成了ph:/,所以因为我使用的是expo媒体库,所以我把它改成了native cameraroll,它可以工作,但奇怪的是它不能用于视频,视频仍然使用旧的assets-library。