React native 将远程资产加载到React本机应用程序WebView
React native 将远程资产加载到React本机应用程序WebView,react-native,webview,React Native,Webview,react native应用程序能否获取远程html/js/css/img文件,保存到本地并加载到WebView 背景: 以以下应用程序结构为例: ├── App.js ├── /remote-assets │ └── /foo │ ├── index.html │ ├── app.js │ ├── styles.js │ └── logo.jpg └── /local-assets ├── util.js └── backgr
react native
应用程序能否获取远程html/js/css/img文件,保存到本地并加载到WebView
背景:
以以下应用程序结构为例:
├── App.js
├── /remote-assets
│ └── /foo
│ ├── index.html
│ ├── app.js
│ ├── styles.js
│ └── logo.jpg
└── /local-assets
├── util.js
└── background.jpg
其思想是,App.js
将资产获取到directoy远程资产
,然后将index.html
加载到网络视图
。该html还将引用相同本地路径中的文件,如:
以及本地资产,例如: