从需要标头的URL中反应本机映像



我需要显示一个Image组件,其中源是一个URL,需要传递http头才能获取它(用于身份验证(。

如何在注册护士中实现这一点?

有没有一种方法可以将头添加到源中?

这是为react native添加的。请参阅此处:

https://reactnative.dev/docs/images.html#network-图像请求

链接中的示例:

<Image
source={{
uri: 'https://reactjs.org/logo-og.png',
method: 'POST',
headers: {
Pragma: 'no-cache',
},
body: 'Your Body goes here',
}}
style={{width: 400, height: 400}}
/>

最新更新