html文件找不到图像,react-native加载静态图片或html , 显示文件找不到
测试手机为android`//webview用的是react-native-webviewimport React, { Component, } from 'react';import { View, Text, Platform, Image, } from 'react-native'import { WebView } from 'react-native-webview';export
测试手机为android
`//webview用的是react-native-webview
import React, { Component, } from 'react';
import { View, Text, Platform, Image, } from 'react-native'
import { WebView } from 'react-native-webview';
export default class Antv extends Component {
constructor(props) {
super(props);
this.state = {
}
}
render() {
return (
ref={ref => (this.webViewRef = ref)}
// onMessage={this.onMessage}
originWhitelist={['*']}
// allowFileAccess={true}
// source={{uri: 'file:///android_asset/china_gdp.html'}}
source={{uri: 'file:///android_asset/base/gdp.html'}}
javaScriptEnabled={true}
// decelerationRate='normal'
scrollEnabled={true}
// useWebKit={true}
// mediaPlaybackRequiresUserAction={true}
// mixedContentMode="compatibility"
// allowingReadAccessToURL="*"
// domStorageEnabled={true}
// onLoadEnd={() => this.setState({ loading: false })}
/>
style={{width: 100, height: 100}}
source={{uri: 'file:///android_asset/base/CustomerAnalysis.png'}}
/>
)
}
}
`
android/app/src/main/assets
这样写完以后,运行,手机显示如下
webview显示没找到文件,Image也没有显示
这是哪里的问题呢?
更多推荐


所有评论(0)