OGeek|极客世界-中国程序员成长平台

标题: ios - 来自 React-Native 中 custom.xcassets 的图像 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 17:23
标题: ios - 来自 React-Native 中 custom.xcassets 的图像

如果我们想使用来自 Images.xcassets 的 React-Native js 中的图像,我们只需提供图像名称作为 URI - 例如。

<Image style = {styles.someStyle} source = {{uri:'addImage.png'}}>

但是如果我们有一个自定义创建的 .xcassets 呢?如何从 RN js 访问该图像集?



Best Answer-推荐答案


它被视为遗留代码,但可以像这样导入:

关于ios - 来自 React-Native 中 custom.xcassets 的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39203388/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4