【发布时间】:2020-07-12 09:00:44
【问题描述】:
我正在使用 Expo 。
import { WebView } from "react-native-webview";
并像上面一样导入 webview 我正在尝试从一些 https url 加载文档文件,它工作正常并在 IOS 中加载 xls 文件,但在 android 中它给出了一个空白屏幕。
<WebView
originWhitelist={["*"]}
source={{ uri: 'https://download.microsoft.com/download/1/4/E/14EDED28-6C58-4055-A65C-23B4DA81C4DE/Financial%20Sample.xlsx' }}
onLoadEnd={() => console.log('end' +Platform.OS)}
javaScriptEnabled={true}
domStorageEnabled={true}
useWebKit={true}
style={styles.WebViewStyle}
startInLoadingState={true}
/>
const styles = {
WebViewStyle: {
flex: 1,
marginLeft: 6,
height: "50%",
width: "97%"
}
}
onLoadEnd 的console.log 不适用于 android,但适用于 IOS。
【问题讨论】:
标签: android react-native webview expo react-native-webview