React-Native - 图像未在Android模拟器中显示

问题描述 投票:4回答:1

为什么图像无法在Android模拟器上呈现?

我只有2个文件:

Index.js

import { AppRegistry } from 'react-native';
import App from './src/App';

AppRegistry.registerComponent('FirstApp', () => App);

App.js

    import React, { Component } from 'react';
    import {View, Image, Text} from 'react-native';

    export default class App extends Component<{}> {
        render() {
            return (
                <View>
                    <Image source={{uri: "https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg"}}
                           style={{width: 193, height: 110}}/>
                    <Text>Some text here..</Text>
                </View>
            );
        }
    }

Android模拟器:

enter image description here

Android设备:

enter image description here

android image react-native
1个回答
3
投票

我的模拟器只是没有网络..

© www.soinside.com 2019 - 2024. All rights reserved.