简体   繁体   English

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

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

Why the image doesn't render on Android emulator?为什么图像无法在 Android 模拟器上呈现?

I have only 2 files:我只有 2 个文件:

Index.js索引.js

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

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

App.js应用程序.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 emulator: Android 模拟器:

在此处输入图像描述

Android device: Android 设备:

在此处输入图像描述

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

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

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

相关问题 React-native:图片未在Android设备中显示; 但在模拟器中显示 - React-native: Images not showing in android device; but shows in emulator React-native:图像未在 android 设备中显示; 但在模拟器中完美显示 - React-native: Images not showing in android device; but shows perfectly in emulator 在android模拟器中运行react-native - running react-native in android emulator React-native,Android模拟器不突出显示检查的元素 - React-native, android emulator does not highlight inspected elements 位置请求在具有React-Native的Android模拟器上超时 - Location request timed out on android emulator with React-Native 无法在 Android 模拟器上运行 React-Native 应用程序 - Windows - Cannot run React-Native app on Android emulator - Windows 如何在VS模拟器上为Android打开react-native开发菜单? - How to open react-native development menu on VS emulator for android? 无法使用 react-native 应用程序在 android 模拟器上登录 Google 帐户 - Could not sign in Google account on android emulator with react-native app 在 Android 模拟器中运行 npx react-native CLI 时出错 - Error in running npx react-native CLI in Android emulator 无法在Android模拟器上运行现有的react-native项目 - Trouble running existing react-native project on Android emulator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM