繁体   English   中英

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

[英]React-Native - Image not showing in Android emulator

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

我只有 2 个文件:

索引.js

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

AppRegistry.registerComponent('FirstApp', () => 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 模拟器:

在此处输入图像描述

Android 设备:

在此处输入图像描述

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

我发现这个视频对于在 Mac 机器的 android 模拟器中打开互联网很有用https://youtu.be/OfGjE8njmC0

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM