我遵循了它起作用的文档,但是使用捕获后返回的图像数据不会出现在新屏幕上。我已经搜索过但没有任何导航图像数据的解决方案。
this is the code for passing the image data to the next screen, alongside a test
the screen for receiving the captured image
答案 0 :(得分:0)
使用此代码导航到屏幕,此处imageFile是从相机捕获后存储图像的状态。
props.navigation.navigate("navigation_route",{image: imageFile})
然后,使用此代码在另一个屏幕上获取图像。
let image = props.navigation.getParam('image')
答案 1 :(得分:0)
要在下一个屏幕中接收图像,请使用以下代码
let image = props.route.params.image
答案 2 :(得分:0)
屏幕发送图像
函数:navigation.navigate('RouteName',{imageTobeTransferred:
state.imageInBase64})
接收屏幕。
const {imageTobeTransferred} = route.params;
返回(
<图片样式= {{......}
source = {{uri:data:image/jpeg;base64, ${imageTobeTransferred}
}} />
)