创建offlne绑定反应原生失败显示图像
问题描述:
我将为我的反应原生iOS应用程序创建脱机绑定。我使用下面的命令它,创建offlne绑定反应原生失败显示图像
react-native bundle --minify --dev false --assets-dest ./ios --entry-file index.ios.js --platform ios --bundle-output ios/main.jsbundle
它创建main.bundle但在设备上的屏幕没有一个图像显示的输出。
我把img
文件夹里的所有图像保存在项目的根目录下。我的文件夹结构, myProjectFolder的
|_android (Project)
img (all image for application)
index.android.js
index.ios.js
ios (Project)
mycustomView.js
node_modules (folder)
package.json
此外,在构建方案我改变调试释放模式。我对图像文件夹的名称应该放在什么位置感到困惑。
感谢
答
的--assets-dest
说法应该只是img
,如--assets-dest img
,所以整个bundle
调用会像:
react-native bundle --minify --dev false --assets-dest img --entry-file index.ios.js --platform ios --bundle-output ios/main.jsbundle
是我想你的方式,但图像不显示。但我试图http://stackoverflow.com/questions/30139736/react-native-cant-load-image这个解决方案,它为我工作。所以我想知道你和他的解决方案有什么不同? 。谢谢 – Tirth