测试手机为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

bVcOWhv

这样写完以后,运行,手机显示如下

bVcOWh3

webview显示没找到文件,Image也没有显示

这是哪里的问题呢?

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐