我可以将标题传递给图像源吗? [英] Can I pass headers to an image source?
本文介绍了我可以将标题传递给图像源吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的图像源是安全的,所以理想情况下我想执行以下操作:
My image-source is secured, so ideally I would like to do the following:
<Image source={{uri: "http://path/to/image",
headers: {Authorization: 'Bearer ' + this.props.bearerToken}}}/>
除了将图像加载到 Javascript 中并从那里渲染图像之外,还有什么我可以近似的吗?
Is there anyway I can approximate that, short of loading the image into Javascript and rendering the image from there?
推荐答案
此功能最近已合并到 React-Native 中:https://github.com/facebook/react-native/pull/7338/files
This capability has recently been merged into React-Native: https://github.com/facebook/react-native/pull/7338/files
这篇关于我可以将标题传递给图像源吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文