【发布时间】:2020-06-19 04:54:01
【问题描述】:
我想在我的 React Native App 中加载一个本地 html 文件。它在 IOS 中有效,但在 Android 中失败。这是我的代码:-
<WebView
originWhitelist={['*']}
source={Platform.OS === 'android' ? { uri: 'file:///android_asset/index.html' } : require('../screens/index.html')}
startInLoadingState={true}
/>
这是我的本地 html 文件路径。
我不知道我应该在哪里配置才能让它工作......请帮助。谢谢。
【问题讨论】:
标签: android react-native webview local-files